From f36c513b180bbe2273f9650b0c03364dc161ae86 Mon Sep 17 00:00:00 2001 From: Daniel-CA Date: Fri, 9 Oct 2015 13:32:03 +0200 Subject: [PATCH] [FIX] mrp_operations_extension: Fixed bug infineloop when updating date_planned --- mrp_operations_extension/models/mrp_production.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrp_operations_extension/models/mrp_production.py b/mrp_operations_extension/models/mrp_production.py index fd5f75b6f..ecbd20cba 100644 --- a/mrp_operations_extension/models/mrp_production.py +++ b/mrp_operations_extension/models/mrp_production.py @@ -126,6 +126,8 @@ class MrpProductionWorkcenterLine(models.Model): def _load_mo_date_planned(self, production, date_planned): if date_planned < production.date_planned: production.write({'date_planned': date_planned}) + return True + return False @api.model def create(self, vals): @@ -141,8 +143,7 @@ class MrpProductionWorkcenterLine(models.Model): def write(self, vals, update=False): if vals.get('date_planned', False): dp = vals.get('date_planned') - self._load_mo_date_planned(self.production_id, dp) - update = True + update = self._load_mo_date_planned(self.production_id, dp) res = super(MrpProductionWorkcenterLine, self).write(vals, update=update) return res