From ce26ef12dc12ebec557b2ec7b9f28d2540a40f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 3 Jan 2026 12:53:56 +0100 Subject: [PATCH] Do not use cached report instance We must always use a copy of the cached report instance to allow to add directives to the template before being prepared. Closes #14460 --- trytond/trytond/report/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/report/report.py b/trytond/trytond/report/report.py index ca7cd3ae4b..136aa76ae0 100644 --- a/trytond/trytond/report/report.py +++ b/trytond/trytond/report/report.py @@ -392,7 +392,7 @@ class Report(URLMixin, PoolBase): loader = relatorio.reporting.MIMETemplateLoader() klass = loader.factories[loader.get_type(mimetype)] template = klass(BytesIO(report.report_content)) - template = report.set_template_cached(template) + report.set_template_cached(template) translate = cls._callback_loader(report, template) if translate: report_context = report_context.copy()