From 63c5db6aa27e46fa455936fc2c0db3ce4a8520f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 3 Apr 2025 16:33:47 +0200 Subject: [PATCH] Add selection_change_with to Selection field's edition_depends Closes #13959 (grafted from a7d89bca1f04329bf43b2ccf644eeacbe077837d) --HG-- branch : 7.0 --- trytond/trytond/model/fields/selection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/fields/selection.py b/trytond/trytond/model/fields/selection.py index f2c08ff9e3..2cea092dba 100644 --- a/trytond/trytond/model/fields/selection.py +++ b/trytond/trytond/model/fields/selection.py @@ -7,7 +7,7 @@ from sql.conditionals import Case from trytond.pool import Pool from trytond.rpc import RPC -from trytond.tools import is_instance_method +from trytond.tools import cached_property, is_instance_method from trytond.tools.string_ import LazyString from trytond.transaction import Transaction @@ -18,6 +18,10 @@ class SelectionMixin(Field): translate_selection = True sort = True + @cached_property + def edition_depends(self): + return super().edition_depends | set(self.selection_change_with) + def translated(self, name=None): "Return a descriptor for the translated value of the field" if name is None: