From 67e258ef1f0630d1b66219090fcbe9a84e48aa1d Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 4 Aug 2020 14:57:21 +0000 Subject: [PATCH] [FIX] mrp: additional workorders start without conflict As additional workorder don't have operation, the cycle computation was wrong and all the start date was set to the same value Task : 2278147 --- 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 ae6aaa5b306..4cf50b555b7 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1160,7 +1160,7 @@ class MrpProduction(models.Model): # Instantiate start_date for the next workorder planning if workorder.next_work_order_id: - if workorder.operation_id.batch == 'no' or workorder.operation_id.batch_size >= qty_to_produce: + if not workorder.operation_id or workorder.operation_id.batch == 'no' or workorder.operation_id.batch_size >= qty_to_produce: start_date = best_finished_date else: cycle_number = float_round(workorder.operation_id.batch_size / best_workcenter.capacity, precision_digits=0, rounding_method='UP')