From f5107b10f5658f51c5cc07c6f3b7e7b0f38bf8d3 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Thu, 7 Feb 2019 21:45:30 +0000 Subject: [PATCH] [FIX] mrp: fix singleton error in _update_raw_move Commit bfb0f1e2a5d3a921bef89718e06c5f68da4f43ac did a very good job not seeing that the lines only used move[0], and called move.field directly. This could result, for certain BoMs, in traceback. opw 1928677 closes odoo/odoo#30938 --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 45eb460a25b..0adfcea608a 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -455,7 +455,7 @@ class MrpProduction(models.Model): move[0].with_context(do_not_unreserve=True).write({'product_uom_qty': quantity}) move[0]._recompute_state() move[0]._action_assign() - move.unit_factor = quantity / move.raw_material_production_id.product_qty + move[0].unit_factor = quantity / move[0].raw_material_production_id.product_qty elif quantity < 0: # Do not remove 0 lines if move[0].quantity_done > 0: raise UserError(_('Lines need to be deleted, but can not as you still have some quantities to consume in them. '))