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

This could be considered as a fix but was not able to be done in a
stable version as automatic mailing could be used to send non-reminders
emails. Or we could simply have users relying on the fact that
reminders could make cancelled attendees change their mind.
This commit is contained in:
qsm-odoo
2017-10-09 15:45:13 +02:00
parent 9959f9a00a
commit cf753a7fdf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -417,7 +417,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
@@ -311,7 +311,7 @@ class EventEvent(models.Model):
self.state = 'confirm'
@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)