From 8df98638d1373aea5994b9f0585b7b291e0001a2 Mon Sep 17 00:00:00 2001 From: jcoux Date: Wed, 27 Jul 2016 09:42:00 +0200 Subject: [PATCH] Fix reports generation --- account_financial_report_qweb/__openerp__.py | 1 + .../report/aged_partner_balance.py | 7 ++----- account_financial_report_qweb/report/general_ledger.py | 7 ++----- account_financial_report_qweb/report/open_items.py | 7 ++----- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/account_financial_report_qweb/__openerp__.py b/account_financial_report_qweb/__openerp__.py index e9317a97..fcc0a69a 100644 --- a/account_financial_report_qweb/__openerp__.py +++ b/account_financial_report_qweb/__openerp__.py @@ -19,6 +19,7 @@ 'date_range', 'account_fiscal_year', 'report_xlsx', + 'report', ], 'data': [ 'wizard/aged_partner_balance_wizard_view.xml', diff --git a/account_financial_report_qweb/report/aged_partner_balance.py b/account_financial_report_qweb/report/aged_partner_balance.py index 731edce9..a34a12df 100644 --- a/account_financial_report_qweb/report/aged_partner_balance.py +++ b/account_financial_report_qweb/report/aged_partner_balance.py @@ -190,11 +190,8 @@ class AgedPartnerBalanceReportCompute(models.TransientModel): self.compute_data_for_report() report_name = 'account_financial_report_qweb.' \ 'report_aged_partner_balance_qweb' - return { - 'type': 'ir.actions.report.xml', - 'report_name': report_name, - 'datas': {'ids': [self.id]}, - } + return self.env['report'].get_action(records=self, + report_name=report_name) @api.multi def compute_data_for_report(self): diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index d590f617..dbca78be 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -189,11 +189,8 @@ class GeneralLedgerReportCompute(models.TransientModel): else: report_name = 'account_financial_report_qweb.' \ 'report_general_ledger_qweb' - return { - 'type': 'ir.actions.report.xml', - 'report_name': report_name, - 'datas': {'ids': [self.id]}, - } + return self.env['report'].get_action(records=self, + report_name=report_name) @api.multi def compute_data_for_report(self): diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py index 9c05ff3a..f4850948 100644 --- a/account_financial_report_qweb/report/open_items.py +++ b/account_financial_report_qweb/report/open_items.py @@ -145,11 +145,8 @@ class OpenItemsReportCompute(models.TransientModel): self.ensure_one() self.compute_data_for_report() report_name = 'account_financial_report_qweb.report_open_items_qweb' - return { - 'type': 'ir.actions.report.xml', - 'report_name': report_name, - 'datas': {'ids': [self.id]}, - } + return self.env['report'].get_action(records=self, + report_name=report_name) @api.multi def compute_data_for_report(self):