Skip to content
Permalink
Browse files

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

Backport of cf753a7
(it was finally considered as a real bug to fix in stable versions
from 10.0).

opw-769955
opw-814459
Closes #22882
  • Loading branch information...
qsm-odoo committed Oct 9, 2017
1 parent 657fe7d commit de62e33618211fd754ad6e372ac93805cce58770
Showing with 2 additions and 2 deletions.
  1. +1 −1 addons/calendar/models/calendar.py
  2. +1 −1 addons/event/models/event.py
@@ -401,7 +401,7 @@ def do_mail_reminder(self, alert):

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):
@@ -272,7 +272,7 @@ def action_event_registration_report(self):
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)

0 comments on commit de62e33

Please sign in to comment.
You can’t perform that action at this time.