diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-05-11 10:32:53 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-05-12 11:53:52 +0000 |
| commit | 1f0f8f21e5e30bdb23c8b0ff035bd4195db6e2ee (patch) | |
| tree | 521a6613a28e10f51f4ec08ff2c38b3b6c7746f0 /addons/calendar | |
| parent | a1ec2ed3cb3251f6cabe51c50d413111bb31deed (diff) | |
[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
Diffstat (limited to 'addons/calendar')
| -rw-r--r-- | addons/calendar/models/calendar_attendee.py | 18 |
1 files 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, |
