From 32976c7f49e8bc427a5b6b1bd3cbf4a3620f06b0 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 31 Jul 2019 13:57:58 +0000 Subject: [PATCH] [FIX] account: simplify report implem. for studio If in web_studio we: - duplicate "Invoices" report - delete "Invoices" report The duplication will not work anymore, since the report class report.account.report_invoice_with_payments is shared but requires account.report_invoice_with_payments (original report). With this changeset, we forgo checking model type of report since it should always be account.invoice anyway. opw-2045435 closes #35349 Signed-off-by: Nicolas Lempereur (nle) --- addons/account/report/account_invoice_report.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 614aba000ab..f6e312b2110 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -189,10 +189,9 @@ class ReportInvoiceWithPayment(models.AbstractModel): @api.model def _get_report_values(self, docids, data=None): - report = self.env['ir.actions.report']._get_report_from_name('account.report_invoice_with_payments') return { 'doc_ids': docids, - 'doc_model': report.model, - 'docs': self.env[report.model].browse(docids), + 'doc_model': 'account.invoice', + 'docs': self.env['account.invoice'].browse(docids), 'report_type': data.get('report_type') if data else '', }