From d248f5afce45a93a19e3f80b83046ee64e61eb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Hennecart=20=28jeh=29?= Date: Fri, 21 Jan 2022 09:29:36 +0000 Subject: [PATCH] [FW][FIX] calendar: use the event_tz in mail templates Try to use the event_tz before falling back on the mail_tz (user tz) in the context. Add a tool method allowing to override this behavior easily instead of concatenating "or". As template is modified anyway translations are already broken. Task-2699765 closes odoo/odoo#86513 X-original-commit: odoo/odoo@6ef642ccdc2448251fd2c5ccc55cf8b340e143e1 Part-of: odoo/odoo#86070 Related: odoo/enterprise#25322 Signed-off-by: Thibault Delavallee (tde) --- addons/calendar/data/mail_template_data.xml | 2 +- addons/calendar/i18n/calendar.pot | 12 ++++++------ addons/calendar/models/calendar_event.py | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/addons/calendar/data/mail_template_data.xml b/addons/calendar/data/mail_template_data.xml index 887afb037ac..cb390fb6e94 100644 --- a/addons/calendar/data/mail_template_data.xml +++ b/addons/calendar/data/mail_template_data.xml @@ -369,7 +369,7 @@ - +
diff --git a/addons/calendar/i18n/calendar.pot b/addons/calendar/i18n/calendar.pot index f1ccb47737f..e096df98b0d 100644 --- a/addons/calendar/i18n/calendar.pot +++ b/addons/calendar/i18n/calendar.pot @@ -173,11 +173,11 @@ msgstr "" msgid "" "
\n" " \n" -" \n" -" \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" "
\n" "
\n" " \n" @@ -272,7 +272,7 @@ msgid "" " Hello Wood Corner,

\n" "\n" " \n" -" Your appointment Schedule a Demo with Ready Mat has been booked.\n" +" Your appointment Schedule a Demo with Ready Mat has been booked.\n" " \n" " \n" " \n" diff --git a/addons/calendar/models/calendar_event.py b/addons/calendar/models/calendar_event.py index 78415b873d4..6131bc4253f 100644 --- a/addons/calendar/models/calendar_event.py +++ b/addons/calendar/models/calendar_event.py @@ -722,6 +722,10 @@ class Meeting(models.Model): self.ensure_one() return ",".join([e for e in self.attendee_ids.mapped("email") if e]) + def _get_mail_tz(self): + self.ensure_one() + return self.event_tz or self.env.user.tz + def _sync_activities(self, fields): # update activities for event in self: