[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#64061 X-original-commit: c01d95d371e859002f09520d3a97436f3b3087b8 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user