From 1f0f8f21e5e30bdb23c8b0ff035bd4195db6e2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 May 2020 10:32:53 +0000 Subject: [PATCH] [FIX] calendar: correctly render template Currently template rendering in calendar returns a tuple instead of real results. This is a followup of 7159f657a009e461ffc16408db40066b901885d1 and probably linked to cleaning done in template while working on new calendar. This commit makes calendar correctly use the rendering API. Spotted when working on task ID 2238597 --- addons/calendar/models/calendar_attendee.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/calendar/models/calendar_attendee.py b/addons/calendar/models/calendar_attendee.py index 0a5366b15b6..f0009684ebd 100644 --- a/addons/calendar/models/calendar_attendee.py +++ b/addons/calendar/models/calendar_attendee.py @@ -124,15 +124,15 @@ class Attendee(models.Model): 'mimetype': 'text/calendar', 'datas': base64.b64encode(ics_file)}) ] - body = self.env['mail.template'].with_context(rendering_context)._render_template( - invitation_template.body_html, - self._name, - attendee.ids) - # TODO check lang - subject = self.env['mail.template']._render_template( - invitation_template.subject, - self._name, - attendee.ids) + body = invitation_template.with_context(rendering_context)._render_field( + 'body_html', + attendee.ids, + compute_lang=True, + post_process=True)[attendee.id] + subject = invitation_template._render_field( + 'subject', + attendee.ids, + compute_lang=True)[attendee.id] attendee.event_id.with_context(no_document=True).message_notify( body=body, subject=subject,