diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-01-23 14:10:09 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-01-23 14:13:13 +0100 |
| commit | 0ec3c75c2dff354a9dfed7e475f227c2f8769256 (patch) | |
| tree | b4ed44051526d5b44716a791990ef00f779fb9a0 | |
| parent | dab5ff7e76af32ee136705e0d4ec7f803c7280fc (diff) | |
[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
| -rw-r--r-- | addons/account/report/report_vat.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/account/report/report_vat.py b/addons/account/report/report_vat.py index 2ad4b7a882e..0a835941187 100644 --- a/addons/account/report/report_vat.py +++ b/addons/account/report/report_vat.py @@ -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'] |
