From aafa890c5cd6b2d6ef3cf684aa464b03fd4666b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 30 Sep 2024 17:22:37 +0200 Subject: [PATCH] Add depends on periods when changing company of tax code context Since fa8f759f834b there is an assert to ensure that changing values of xxx2Many can be done only if the field had a initial value. Closes #13535 --- modules/account/tax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account/tax.py b/modules/account/tax.py index 16fb557b10..93ad8fa5bb 100644 --- a/modules/account/tax.py +++ b/modules/account/tax.py @@ -542,7 +542,8 @@ class TaxCodeContext(ModelView): return Transaction().context.get('company') @fields.depends( - 'company', 'fiscalyear', 'period', methods=['on_change_with_periods']) + 'company', 'fiscalyear', 'period', 'periods', + methods=['on_change_with_periods']) def on_change_company(self): if self.fiscalyear and self.fiscalyear.company != self.company: self.fiscalyear = None