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
This commit is contained in:
Cédric Krier
2024-09-30 17:22:37 +02:00
parent e16889a592
commit aafa890c5c
+2 -1
View File
@@ -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