From ac37269341a02d4a5c5da64bb70a5d755204d85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= <100228798+clementcharmillot@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:57:06 +0200 Subject: [PATCH] fix: fix preview rendering (#1943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément --- crm_request/wizards/holiday_template_preview.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crm_request/wizards/holiday_template_preview.py b/crm_request/wizards/holiday_template_preview.py index 67cd672d2..7a35ab269 100644 --- a/crm_request/wizards/holiday_template_preview.py +++ b/crm_request/wizards/holiday_template_preview.py @@ -24,9 +24,10 @@ def get_default(self): for lang in self.env["res.lang"].search([]): res += f"

{lang.name}:

" fake_claim.language = lang.code - res += template.with_context( + rendered = template.with_context( lang=lang.code, salutation_language=lang.code - )._render_template(template.body_html, template.model, fake_claim.id) + )._render_template(template.body_html, template.model, [fake_claim.id]) + res += rendered[fake_claim.id] res += "

" fake_claim.unlink() return res