Copy pattern of production lead time before modification
We should not modify the caller mutable structure.
This commit is contained in:
@@ -305,8 +305,7 @@ class Production(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
@fields.depends('product', 'bom')
|
||||
def compute_lead_time(self, pattern=None):
|
||||
if pattern is None:
|
||||
pattern = {}
|
||||
pattern = pattern.copy() if pattern is not None else {}
|
||||
if self.product:
|
||||
pattern.setdefault('bom', self.bom.id if self.bom else None)
|
||||
for line in self.product.production_lead_times:
|
||||
|
||||
@@ -28,8 +28,7 @@ class Production(metaclass=PoolMeta):
|
||||
|
||||
@fields.depends('routing')
|
||||
def on_change_with_planned_start_date(self, pattern=None):
|
||||
if pattern is None:
|
||||
pattern = {}
|
||||
pattern = pattern.copy() if pattern is not None else {}
|
||||
pattern.setdefault(
|
||||
'routing', self.routing.id if self.routing else None)
|
||||
return super(Production, self).on_change_with_planned_start_date(
|
||||
|
||||
Reference in New Issue
Block a user