[FIX] mrp: fix singleton error in _update_raw_move

Commit bfb0f1e2a5
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
This commit is contained in:
Nans Lefebvre
2019-02-07 21:45:32 +00:00
parent a02e277817
commit f5107b10f5
+1 -1
View File
@@ -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. '))