If no period is selected, use all the periods of the fiscal year

This commit is contained in:
Guewen Baconnier
2014-11-19 10:09:59 +01:00
parent 983d7dfe08
commit 463040bcaf

View File

@@ -37,14 +37,16 @@ class AccountTaxDeclarationAnalysis(models.TransientModel):
column1='tax_analysis',
column2='period_id',
string='Periods',
required=True,
help="If no period is selected, all the periods of the "
"fiscal year will be used",
)
@api.multi
def show_vat(self):
if not self.period_list:
raise exceptions.Warning(_("You must select periods"))
domain = [('period_id', 'in', self.period_list.ids)]
periods = self.period_list
if not periods:
periods = self.fiscalyear_id.period_ids
domain = [('period_id', 'in', periods.ids)]
action = self.env.ref('account_tax_analysis.action_view_tax_analysis')
action_fields = action.read()[0]
action_fields['domain'] = domain