diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 968759cd2d5..f77e2c155f4 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -499,11 +499,14 @@ class MrpProduction(models.Model): @api.multi def post_inventory(self): for order in self: + moves_not_to_do = order.move_raw_ids.filtered(lambda x: x.state == 'done') moves_to_do = order.move_raw_ids.filtered(lambda x: x.state not in ('done', 'cancel')) 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() + for move in moves_to_finish: #Group quants by lots lot_quants = {}