[FIX] calendar: do not write end time before start time of an event
The end time of a calendar event is constrained to never be before the start of te event. However when updating events, one path would first update the start of the event before updating the end of the event. So in case where (s_1, e_1) is updated by (s_2, e_2), with respectively s_i < e_i, if s2 > e1 then the update would violate the constraint and thus crash the calendar update. opw 1854394
This commit is contained in:
@@ -816,8 +816,8 @@ class Meeting(models.Model):
|
||||
startdate = startdate.astimezone(pytz.utc) # Convert to UTC
|
||||
meeting.start = fields.Datetime.to_string(startdate)
|
||||
else:
|
||||
meeting.start = meeting.start_datetime
|
||||
meeting.stop = meeting.stop_datetime
|
||||
meeting.write({'start': meeting.start_datetime,
|
||||
'stop': meeting.stop_datetime})
|
||||
|
||||
@api.depends('byday', 'recurrency', 'final_date', 'rrule_type', 'month_by', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'day', 'week_list')
|
||||
def _compute_rrule(self):
|
||||
|
||||
Reference in New Issue
Block a user