From 9f883c973ef879c21f6bb5d49c406ef3346983d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 11 Dec 2024 23:49:56 +0100 Subject: [PATCH] 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 --- modules/quality/quality.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/quality/quality.py b/modules/quality/quality.py index 70a39d40c7..d9bb4af1bb 100644 --- a/modules/quality/quality.py +++ b/modules/quality/quality.py @@ -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}