Thursday, October 17, 2024
2 changes · saas-17.1
Miscellaneous changes
### Steps to reproduce: - Create and confirm a delivery for 10 units of a product P - Change the quantity of the move to 5 and mark it as picked - Click on the "detailed operations" button of the picking - Change the quantity of the move line to 3 - Create a new line for 2 units (this would make sense if you want to register 2 lots for instance the flow is kepts as simple possible) - Go back to the delivery, validate and create a back order #### > A back order is created for 7 units r
Original PR description
### Steps to reproduce: - Create and confirm a delivery for 10 units of a product P - Change the quantity of the move to 5 and mark it as picked - Click on the "detailed operations" button of the…
### Steps to reproduce: - Create and confirm a delivery for 10 units of a product P - Change the quantity of the move to 5 and mark it as picked - Click on the "detailed operations" button of the picking - Change the quantity of the move line to 3 - Create a new line for 2 units (this would make sense if you want to register 2 lots for instance the flow is kepts as simple possible) - Go back to the delivery, validate and create a back order #### > A back order is created for 7 units rather than 5 and the original delivery was validated for only 3 units. ### Cause of the issue: When you create a new move line on the picking from the detailed operation it is linked to the move of the picking via these lines: https://github.com/odoo/odoo/blob/4c79aceb3a6c08453f9ec66131e1bc525eae140c/addons/stock/models/stock_move_line.py#L325-L331 However, while the move is marked as picked, the newly created move line is not. As such during the `_action_done` of the stock move, the new sml will be unlinked from the move: https://github.com/odoo/odoo/blob/4c79aceb3a6c08453f9ec66131e1bc525eae140c/addons/stock/models/stock_move.py#L1865-L1872 opw-4100293 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178017
### Steps to reproduce: - Create a MO for a product without BOM (no need of components) - Go to the "Work Orders" tab and create 2 operations: op1 and op2 - Confirm the MO - Start the operation waiting for an other WO (op2) - Create a third operation: op3 - Save #### > Validation Error: You cannot create a cyclic dependency. ### Cause of the Issue: During the creation of op3, all the workorders of our MO will be confirmed to ensures that the links of the 3 operations are correctly
Original PR description
### Steps to reproduce: - Create a MO for a product without BOM (no need of components) - Go to the "Work Orders" tab and create 2 operations: op1 and op2 - Confirm the MO - Start the operation…
### Steps to reproduce: - Create a MO for a product without BOM (no need of components) - Go to the "Work Orders" tab and create 2 operations: op1 and op2 - Confirm the MO - Start the operation waiting for an other WO (op2) - Create a third operation: op3 - Save #### > Validation Error: You cannot create a cyclic dependency. ### Cause of the Issue: During the creation of op3, all the workorders of our MO will be confirmed to ensures that the links of the 3 operations are correctly made: https://github.com/odoo/odoo/blob/d2ce6622f2d6f1917dc319112a688e35a73c2088/addons/mrp/models/mrp_workorder.py#L469-L474 This will trigger a call of the `_link_workorders_and_moves` to re-link them all. However, during this call since op2 has been started the order of the workorders will be op2 > op1 rather than op1 > op2 and since the MO has no bom nor `operation_id` the records will not be reordered correctly before being linked: https://github.com/odoo/odoo/blob/d2ce6622f2d6f1917dc319112a688e35a73c2088/addons/mrp/models/mrp_production.py#L1472-L1473 https://github.com/odoo/odoo/blob/d2ce6622f2d6f1917dc319112a688e35a73c2088/addons/mrp/models/mrp_production.py#L1485-L1487 This will create a loop on the m2m dependency since op1 will be blocked by op2 and op2 is already blocked by op1. This is detected by the framework which raises the error. opw-4105603 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177402