Skip to content
Snippets Groups Projects
Commit c1367547 authored by paso-odoo's avatar paso-odoo
Browse files

[FIX] mrp: confirm MO with deleted WO


If there are some dependencies between BoM's operations, a traceback
will appear when the user removes one WO.

Steps to produce:
- From Manufacturing > Configuration: Enable Work Orders.
- Open any Bills of Material.
- In 'Miscellaneous' tab tick the 'Operation Dependencies' boolean.
- Set 3 or more operations in the 'Operations' tab.
- After saving the BOM add 'Blocked By' in the operations.
- Now Create Manufacturing Order for that BOM.
- Delete the one or more workorder(s) from mrp order.
- Now click on the 'Confirm' button, and the error will be raised.

The loop is incorrect because we iterate on the BoM's operations but
the keys of the dict `workorder_per_operation` are based on the MO's
work orders. Therefore, if we remove one WO, the dict will not have
any key for the related operation, hence the traceback.

sentry-4146643254

closes odoo/odoo#120745

Related: odoo/enterprise#41956
Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
parent 3619f77c
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment