diff options
| author | Thibault Delavallée <tde@odoo.com> | 2021-01-05 08:12:30 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2021-01-05 08:14:53 +0000 |
| commit | c01d95d371e859002f09520d3a97436f3b3087b8 (patch) | |
| tree | d54ece6da67f1c4420a4453af42f8d114d5fac80 /addons | |
| parent | 7d04ec7cca4f355295a06c1ce6f112b6cc533c87 (diff) | |
[FW][FIX] calendar: synchronize email_from and author_id when sending email to attendees
When emails related to calendar events are sent email_from is set from
templates like invite template. Author of those email is however not set
and current user is used as default value.
In this commit we do as done in templates and try to set event responsible
as user, and fall back on current user if not set.
This notably solves an issue when using website_calendar. Appointments are
done using public user and mails have public user as author. This leads to
emails not being accessible or having a false email_from.
Task ID-2413792
closes odoo/odoo#64027
X-original-commit: odoo/odoo@160d321
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/calendar/models/calendar_attendee.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/calendar/models/calendar_attendee.py b/addons/calendar/models/calendar_attendee.py index 0aeb5d51a63..24db4c7ec41 100644 --- a/addons/calendar/models/calendar_attendee.py +++ b/addons/calendar/models/calendar_attendee.py @@ -135,6 +135,8 @@ class Attendee(models.Model): attendee.ids, compute_lang=True)[attendee.id] attendee.event_id.with_context(no_document=True).message_notify( + email_from=attendee.event_id.user_id.email_formatted or self.env.user.email_formatted, + author_id=attendee.event_id.user_id.partner_id.id or self.env.user.partner_id.id, body=body, subject=subject, partner_ids=attendee.partner_id.ids, |
