Add company domain to fiscalyear of reporting contexts
issue11206 review376651002
This commit is contained in:
+17
-1
@@ -2035,7 +2035,11 @@ class GeneralLedgerAccountContext(ModelView):
|
||||
'General Ledger Account Context'
|
||||
__name__ = 'account.general_ledger.account.context'
|
||||
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
|
||||
required=True)
|
||||
required=True,
|
||||
domain=[
|
||||
('company', '=', Eval('company')),
|
||||
],
|
||||
depends=['company'])
|
||||
start_period = fields.Many2One('account.period', 'Start Period',
|
||||
domain=[
|
||||
('fiscalyear', '=', Eval('fiscalyear')),
|
||||
@@ -2119,6 +2123,12 @@ class GeneralLedgerAccountContext(ModelView):
|
||||
def default_to_date(cls):
|
||||
return Transaction().context.get('to_date')
|
||||
|
||||
@fields.depends('company', 'fiscalyear', methods=['on_change_fiscalyear'])
|
||||
def on_change_company(self):
|
||||
if self.fiscalyear and self.fiscalyear.company != self.company:
|
||||
self.fiscalyear = None
|
||||
self.on_change_fiscalyear()
|
||||
|
||||
@fields.depends('fiscalyear', 'start_period', 'end_period')
|
||||
def on_change_fiscalyear(self):
|
||||
if (self.start_period
|
||||
@@ -2586,6 +2596,12 @@ class IncomeStatementContext(ModelView):
|
||||
def default_comparison(cls):
|
||||
return False
|
||||
|
||||
@fields.depends('company', 'fiscalyear', methods=['on_change_fiscalyear'])
|
||||
def on_change_company(self):
|
||||
if self.fiscalyear and self.fiscalyear.company != self.company:
|
||||
self.fiscalyear = None
|
||||
self.on_change_fiscalyear()
|
||||
|
||||
@fields.depends('fiscalyear', 'start_period', 'end_period')
|
||||
def on_change_fiscalyear(self):
|
||||
if (self.start_period
|
||||
|
||||
Reference in New Issue
Block a user