Reassign points value instead of updating when changing quality control
The value of points is an immutable dictionary that can not be updated. Closes #13730 (grafted from d8119a6255ea750c4f4d9c4f54ba1485270012b0) --HG-- branch : 7.0
This commit is contained in:
@@ -437,10 +437,10 @@ class Inspection(Workflow, ModelSQL, ModelView):
|
||||
@fields.depends('control', 'points')
|
||||
def on_change_control(self):
|
||||
if self.control:
|
||||
if self.points is None:
|
||||
self.points = {}
|
||||
self.points.update(
|
||||
points = dict(self.points) if self.points is not None else {}
|
||||
points.update(
|
||||
(p.name, None) for p in self.control.points)
|
||||
self.points = points
|
||||
|
||||
def validate_points(self):
|
||||
points = {p.name: p.string for p in self.control.points}
|
||||
|
||||
Reference in New Issue
Block a user