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
This commit is contained in:
Cédric Krier
2024-12-11 23:49:56 +01:00
parent b26ff9757e
commit 67e200848d
+3 -3
View File
@@ -469,10 +469,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}