Tuesday, October 28, 2025
2 changes · 17.0
Resolved issues and error corrections
Updating the quantity to produce for subcontracted manufacturing orders no longer creates extra component lines without lot or serial numbers when stock is already reserved. This reduces manual corrections and helps users validate receipts without avoidable lot/serial errors.
Original PR description
,*=mrp_subcontracting_purchase Issue Before This Commit: ======================= When a user updates `qty_producing` in a subcontracting MO, it creates new move lines with empty lots or serials, even…
,*=mrp_subcontracting_purchase Issue Before This Commit: ======================= When a user updates `qty_producing` in a subcontracting MO, it creates new move lines with empty lots or serials, even though the required quantity is already available in existing reserved move lines. This requires the user to manually reassign lots/serials; otherwise, validating the picking raises a UserError of `missing Lot/Serial numbers`. Steps to Reproduce: ======================= - Install the `mrp_subcontracting_purchase` module. - Create product1 with Vendor1. Create product2 with lot tracking and set it `Resupply Subcontractor on order` in Inventory. - Create a BOM for product1, with product2 as a component (quantity 10) and subcontractor Vendor1. - Create and confirm a purchase order for product1 (quantity 10) with Vendor1. - Go to Resupply → Supply Product2, deliver 100 units of Product2 to Vendor1 using lot-01, then validate the picking. - Go to the source PO → Receipt → Record Component. Observe that the move line is created with 100 units from lot-01 - Set qty_producing to 5 → the current component line updates to 50 quantity. - Increase qty_producing to 10 → a new line is created with empty lot and quantity 50, even though the existing line already has 100 of the same lot. Cause of the issue: ======================= When `qty_producing` is updated in the subcontracting MO wizard, the `_set_quantity_done_prepare_vals` method recalculates quantities based on the already modified move line quantity instead of referencing its original `reserved quantity`.This causes incorrect comparisons on subsequent updates, leading to the creation of new move lines with empty lots even when sufficient quantity already exists in the existing move line. With This Commit: ======================= `_set_quantity_done_prepare_vals` method now uses `ml._origin.quantity or ml.quantity`. ` _origin.quantity` ensures the reserved quantity of existing move lines is counted, while `ml.quantity` handles newly created lines without an origin. This prevents unnecessary move lines with empty lots when sufficient quantity already exists in existing reserved lines, eliminating manual reassignment and avoiding UserError on picking validation.
Belgian payroll now correctly stops paying public holidays that fall during long-term sick leave after the 30-day threshold. This prevents overpayment and helps payroll calculations follow Belgian employment rules more accurately.
Original PR description
Bug: In Belgium, after 30 calendar days of sick leave, all public holidays during the sick leaves are no longer paid. But here they were still being paid. Cause: The method that was checking what to do about public holidays was never seeing public holidays since they were already changed to their corresponding work entries at the work entry generation. Fix: Add the public holidays in the context and change the condition for checking if the current leave is actually from a public holiday or not. Task: 3864585