[FIX] account: default value for report_vat report

If the report was printed from the tax codes list
Accounting > Configuration > Taxes > Tax codes
There is no information concerning what should be displayed (periods, details, etc.)
as the user did not printed the report from the wizard
(from Accounting > Reporting > Generic Reporting > Taxes > Taxes report)
We therefore set default values, in order the report to not crash

Nevertheless, the user has obviously to go through the wizard
if he wants to set a configuration different than the default one
This commit is contained in:
Denis Ledoux 2015-01-23 14:10:09 +01:00
parent dab5ff7e76
commit 0ec3c75c2d
1 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,15 @@ class tax_report(report_sxw.rml_parse, common_report_header):
def set_context(self, objects, data, ids, report_type=None):
new_ids = ids
res = {}
if not data:
company_id = self.pool['res.users'].browse(self.cr, self.uid, self.uid).company_id.id
data = {
'form': {
'based_on': 'invoices',
'company_id': company_id,
'display_detail': False,
}
}
self.period_ids = []
period_obj = self.pool.get('account.period')
self.display_detail = data['form']['display_detail']