[FIX] calendar, event: do not send emails to canceled attendees

Backport of https://github.com/odoo/odoo/commit/cf753a7fdf1739dcf37d2ad74f4c8efb3d4ff3b3
(it was finally considered as a real bug to fix in stable versions
from 10.0).

opw-769955
opw-814459
Closes https://github.com/odoo/odoo/pull/22882
This commit is contained in:
qsm-odoo
2018-02-19 14:27:29 +01:00
parent 657fe7da71
commit de62e33618
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ class AlarmManager(models.AbstractModel):
result = False
if alarm.type == 'email':
result = meeting.attendee_ids._send_mail_to_attendees('calendar.calendar_template_meeting_reminder', force_send=True)
result = meeting.attendee_ids.filtered(lambda r: r.state != 'declined')._send_mail_to_attendees('calendar.calendar_template_meeting_reminder', force_send=True)
return result
def do_notif_reminder(self, alert):
+1 -1
View File
@@ -272,7 +272,7 @@ class EventEvent(models.Model):
return res
@api.one
def mail_attendees(self, template_id, force_send=False, filter_func=lambda self: True):
def mail_attendees(self, template_id, force_send=False, filter_func=lambda self: self.state != 'cancel'):
for attendee in self.registration_ids.filtered(filter_func):
self.env['mail.template'].browse(template_id).send_mail(attendee.id, force_send=force_send)