Skip to content

Commit

Permalink
[FIX] account: default value for report_vat report
Browse files Browse the repository at this point in the history
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
  • Loading branch information
beledouxdenis committed Jan 23, 2015
1 parent dab5ff7 commit 0ec3c75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions addons/account/report/report_vat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 0ec3c75

Please sign in to comment.