diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index ad776b6cfb0..2962fbd4fa2 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -816,11 +816,13 @@ class MrpProduction(models.Model): moves_to_do = order.move_raw_ids.filtered(lambda x: x.state not in ('done', 'cancel')) for move in moves_to_do.filtered(lambda m: m.product_qty == 0.0 and m.quantity_done > 0): move.product_uom_qty = move.quantity_done - moves_to_do._action_done() + # MRP do not merge move, catch the result of _action_done in order + # to get extra moves. + moves_to_do = moves_to_do._action_done() moves_to_do = order.move_raw_ids.filtered(lambda x: x.state == 'done') - moves_not_to_do order._cal_price(moves_to_do) moves_to_finish = order.move_finished_ids.filtered(lambda x: x.state not in ('done', 'cancel')) - moves_to_finish._action_done() + moves_to_finish = moves_to_finish._action_done() order.action_assign() consume_move_lines = moves_to_do.mapped('move_line_ids') for moveline in moves_to_finish.mapped('move_line_ids'):