Friday, July 5, 2024
1 change · saas-17.2
Resolved issues and error corrections
Stock lots will now use the company linked to their related product by default, even when another default company is present in the workflow. This prevents lots from being assigned to the wrong company or getting a company when they should not, improving accuracy in multi-company inventory operations.
Original PR description
Now that lots can be set without company, we want them to have by default the company of their related product. The issue is that if there is a `default_company_id` set in the context at any point, it will prevent the computation of the right `company_id`, causing the wrong company (or a company where there shouldn't be one) to be set on the lot. To prevent this, we simply pop the `default_company_id` from the context if present when checking the default values, forcing the use of the compute instead. Also restores the `default_company_id` in `action_generate_lot_line_vals`, as this removes the default from move lines, and is no longer necessary for lots. Description of the issue/feature this PR addresses: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr