From 57a32316afdd82843d0fe2381a7db5846affdb2d Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Tue, 16 Jun 2020 11:52:13 +0000 Subject: [PATCH] [FIX] mrp: reference to enterprise variable Usecase to reproduce: - Create 2 table(MTO) - Produce 1 and use BO button Traceback due to a reference to enterprise field. closes odoo/odoo#53077 X-original-commit: 2fffc12f8e3cdccba4b1c9820f997f4b10dac330 Related: odoo/enterprise#11191 Signed-off-by: Arnold Moyaux --- addons/mrp/models/mrp_production.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 6b60b81ec23..7a58b069198 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1373,9 +1373,7 @@ class MrpProduction(models.Model): for workorder in backorder_mo.workorder_ids: workorder.duration_expected = workorder.duration_expected * (1 - ratio) backorders.action_confirm() - for wo in backorders.workorder_ids: - if wo.component_id: - wo._update_component_quantity() + # Remove the serial move line without reserved quantity. Post inventory will assigned all the non done moves # So those move lines are duplicated. backorders.move_raw_ids.move_line_ids.filtered(lambda ml: ml.product_id.tracking == 'serial' and ml.product_qty == 0).unlink()