[FIX] mrp: don't add missing consump warning line to backorder

Previous fix odoo/odoo#131279 missed marking component lines added in
from the consumption warning wizard as "additional". This made it so the
added line was also added into the backorder when it should NOT have
been (since the backorder should only be based on the original MO's
values).

Followup of task: 3456604

closes odoo/odoo#136728

X-original-commit: 7a45b691781e2862e87da7914a8b3b9a6487b7e9
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
This commit is contained in:
Tiffany Chang (tic)
2023-09-28 03:19:07 +00:00
parent 2b78a43185
commit 6dc02294a0
+4
View File
@@ -3465,6 +3465,10 @@ class TestMrpOrder(TestMrpCommon):
self.assertEqual(move.product_uom_qty, 48, "expected qty should be unchanged")
self.assertEqual(move.quantity_done, 4, "expected qty was not applied as qty to be done (UoM was possibly not correctly converted)")
self.assertEqual(mo2.state, 'done')
# double check that backorder qtys are also correct
mo2_backorder = mo2.procurement_group_id.mrp_production_ids[-1]
self.assertEqual(len(mo2_backorder.move_raw_ids), 1, "missing line should NOT have been added in")
self.assertEqual(mo2_backorder.move_raw_ids[0].product_uom_qty, 12, "backorder values are based on original MO, not current bom")
#### scenario 3 - repeated comp move ####
# bom.bom_line_ids[0]/product_id = p2