From 67e200848df14995acdb340c7e48b19bb369e5e9 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 --- 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 79141bc765..fa7d246d60 100644 --- a/modules/quality/quality.py +++ b/modules/quality/quality.py @@ -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}