From 21834430a15a12dae2f94426533df99384a1a1ea Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 3 Dec 2019 13:22:25 +0000 Subject: [PATCH] [FIX] mrp: post partial production with workorders The commit 75460e697a20505aa22b3a273d3056e0bdc75633 was introduced in v12, when the workorder stored their consume data on stock.move.lines. Their was an issue when posting intermediary inventory on productions using workorder. As those 'dummy' stock.move.lines did not have their lot field filled, an error at line validation was raised. In v13, the workorders use workorder lines. The lots and quantity are transfered on real stock move lines only at the end of the production. Posting intermediary inventory did not failed anymore in case of partial production Task : 54665 X-original-commit: a41239b378a1cae394d18f43e991ec8bceeac826 --- addons/mrp/models/mrp_production.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 1e29203d220..248ac58e562 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -375,7 +375,6 @@ class MrpProduction(models.Model): order.post_visible = order.is_locked and any((x.quantity_done > 0 and x.state not in ['done', 'cancel']) for x in order.move_raw_ids | order.move_finished_ids) else: order.post_visible = order.is_locked and any((x.quantity_done > 0 and x.state not in ['done', 'cancel']) for x in order.move_finished_ids) - order.post_visible &= all(wo.state in ['done', 'cancel'] for wo in order.workorder_ids) or all(m.product_id.tracking == 'none' for m in order.move_raw_ids) @api.depends('workorder_ids.state', 'move_finished_ids', 'move_finished_ids.quantity_done', 'is_locked') def _get_produced_qty(self):