diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py index 05dc13d8a0f..d504eac3ae9 100644 --- a/addons/account/models/ir_actions_report.py +++ b/addons/account/models/ir_actions_report.py @@ -44,10 +44,13 @@ class IrActionsReport(models.Model): } return collected_streams + def _is_invoice_report(self, report_ref): + return self._get_report(report_ref).report_name in ('account.report_invoice_with_payments', 'account.report_invoice') + def _render_qweb_pdf(self, report_ref, res_ids=None, data=None): # Check for reports only available for invoices. # + append context data with the display_name_in_footer parameter - if self._get_report(report_ref).report_name in ('account.report_invoice_with_payments', 'account.report_invoice'): + if self._is_invoice_report(report_ref): invoices = self.env['account.move'].browse(res_ids) if self.env['ir.config_parameter'].sudo().get_param('account.display_name_in_footer'): data = data and dict(data) or {} diff --git a/addons/account_edi/models/ir_actions_report.py b/addons/account_edi/models/ir_actions_report.py index 45ad7ba007a..2831321d410 100644 --- a/addons/account_edi/models/ir_actions_report.py +++ b/addons/account_edi/models/ir_actions_report.py @@ -16,7 +16,7 @@ class IrActionsReport(models.Model): if collected_streams \ and res_ids \ and len(res_ids) == 1 \ - and self._get_report(report_ref).report_name in ('account.report_invoice_with_payments', 'account.report_invoice'): + and self._is_invoice_report(report_ref): invoice = self.env['account.move'].browse(res_ids) if invoice.is_sale_document() and invoice.state != 'draft': to_embed = invoice.edi_document_ids diff --git a/addons/l10n_ch/models/ir_actions_report.py b/addons/l10n_ch/models/ir_actions_report.py index b4725a83e2c..8e45d517742 100644 --- a/addons/l10n_ch/models/ir_actions_report.py +++ b/addons/l10n_ch/models/ir_actions_report.py @@ -33,7 +33,7 @@ class IrActionsReport(models.Model): if not res_ids: return res report = self._get_report(report_ref) - if report.report_name in ('account.report_invoice_with_payments', 'account.report_invoice'): + if self._is_invoice_report(report_ref): invoices = self.env[report.model].browse(res_ids) # Determine which invoices need a QR. qr_inv_ids = []