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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user