Friday, April 11, 2025
1 change · saas-17.4
Resolved issues and error corrections
Sales orders using three-step manufacturing no longer fail when a customer reference is entered. Manufacturing orders are now assigned their own unique sequence-based references, preventing duplicate-name errors and keeping order confirmation running smoothly.
Original PR description
When the warehouse is set to pbm_sam, MOs are assigned the procurement group name if the move origin differs from the group_id. This causes a validation error when confirming a sales order with a…
When the warehouse is set to pbm_sam, MOs are assigned the procurement group name if the move origin differs from the group_id. This causes a validation error when confirming a sales order with a client_order_ref, as MO references must be unique per company. For example, if an SO has a reference S00011 - test_client_order_ref, it differs from S00011, leading to an MO name conflict. This fix ensures that MO names are always generated using the picking type sequence instead of inheriting the procurement group name, preventing duplicate references or incorrectly setting the MO name as the SO name. Current behavior before PR: If there is more than one sale order line with MTO products: We get a duplicate name error If there is one sale order line with an MTO product: We get a MO.name == SO.name Desired behavior after PR is merged: Both cases are resolved and the MO(s) are successfully created with the appropriate name Steps to reproduce: 1.) Install sales; inventory; manufacturing 2.) Enable multi-step routes 3.) Unarchive MTO 4.) Set warehouse manufacture steps to: Pick components, manufacture, then store products (3 steps) (manufacture_steps == 'pbm_sam') 5.) Unarchive MTO 6.) Create two storable products (enable manufacture and mto routes) 7.) Create an SO with both products 8.) Add any text to the Customer Reference on the sales order (client_order_ref) 9.) Try to confirm the SO Validation Error The operation cannot be completed: Reference must be unique per Company! --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr