From c06ea3bd9904eb73738f8d8ce6cfe1fa00fe9edb Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Thu, 26 Mar 2026 19:58:14 +0100 Subject: [PATCH] 26.03.26 --- modules/account_invoice/invoice.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/account_invoice/invoice.py b/modules/account_invoice/invoice.py index 49b924e..7a00e0b 100755 --- a/modules/account_invoice/invoice.py +++ b/modules/account_invoice/invoice.py @@ -3695,13 +3695,19 @@ class InvoiceReport(Report): Invoice = pool.get('account.invoice') # Re-instantiate because records are TranslateModel invoice, = Invoice.browse(records) - if invoice.invoice_report_cache: + report_path = cls._get_action_report_path(action) + use_cache = ( + report_path in (None, 'account_invoice/invoice.fodt') + and invoice.invoice_report_cache + ) + if use_cache: return ( invoice.invoice_report_format, invoice.invoice_report_cache) else: result = super()._execute(records, header, data, action) - if invoice.invoice_report_versioned: + if (invoice.invoice_report_versioned + and report_path in (None, 'account_invoice/invoice.fodt')): format_, data = result if isinstance(data, str): data = bytes(data, 'utf-8') @@ -3718,6 +3724,12 @@ class InvoiceReport(Report): with Transaction().set_context(language=False): return super().render(*args, **kwargs) + @staticmethod + def _get_action_report_path(action): + if isinstance(action, dict): + return action.get('report') + return getattr(action, 'report', None) + @classmethod def execute(cls, ids, data): pool = Pool()