summaryrefslogtreecommitdiff
path: root/addons/calendar/models
diff options
context:
space:
mode:
authorKevin Baptiste <kba@odoo.com>2020-11-30 09:33:45 +0000
committerKevin Baptiste <kba@odoo.com>2020-11-30 09:46:48 +0000
commite31819bccec604ba61c053015304abebdd189690 (patch)
tree84381a636b3b0038ca16876a0e4e804a361c7ebf /addons/calendar/models
parent03fc6e0276d93267efe0a23cf6209816188ce730 (diff)
[FIX] calendar: do not send updates on past events
Before this commit, a notification was sent to all the attendees whenever a past event was modified. Now the notification is only sent if the event is taking place in the future. closes odoo/odoo#62584 Taskid: 2409394 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/calendar/models')
-rw-r--r--addons/calendar/models/calendar_event.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/calendar/models/calendar_event.py b/addons/calendar/models/calendar_event.py
index 27a6a2a006d..61ce4ef387d 100644
--- a/addons/calendar/models/calendar_event.py
+++ b/addons/calendar/models/calendar_event.py
@@ -673,7 +673,10 @@ class Meeting(models.Model):
if 'partner_ids' in values:
(current_attendees - previous_attendees)._send_mail_to_attendees('calendar.calendar_template_meeting_invitation')
if 'start' in values:
- (current_attendees & previous_attendees)._send_mail_to_attendees('calendar.calendar_template_meeting_changedate', ignore_recurrence=not update_recurrence)
+ start_date = fields.Datetime.to_datetime(values.get('start'))
+ # Only notify on future events
+ if start_date and start_date >= fields.Datetime.now():
+ (current_attendees & previous_attendees)._send_mail_to_attendees('calendar.calendar_template_meeting_changedate', ignore_recurrence=not update_recurrence)
return True