From 0ec3c75c2dff354a9dfed7e475f227c2f8769256 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 23 Jan 2015 14:10:09 +0100 Subject: [PATCH] [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 --- addons/account/report/report_vat.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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']