From 648a3af3ca8b5a8dee82c900970c4f84d57df82a Mon Sep 17 00:00:00 2001 From: Abridbus Date: Wed, 12 Jun 2019 14:07:50 +0000 Subject: [PATCH] [FIX] calendar: exclusive recurrent event from Google with empty update value During a Google Calendar sync, exclusive instance of a recurrent event to which you are not the owner and without an update datetime shouldn't be considered. See developers.google.com/calendar/v3/reference/events/update where cancelled status event might have empty fields. > A cancelled status represents two different states > depending on the event type: > Cancelled exceptions of an uncancelled recurring event indicate > that this instance should no longer be presented to the user. > Clients should store these events for the lifetime of the parent recurring event. > Cancelled exceptions are only guaranteed to have values for the id, > recurringEventId and originalStartTime fields populated. The other fields might be empty. As you are not the owner, the event shouldn't be deleted from Odoo as the actual event owner might still attend the meeting. It should just remove the user who is syncing his calendar from the attendees, but as the sync currently doesn't support syncing event without an update datetime from Google, we just choose to ignore the sync of this event. The attendee will be removed/marked as not attending when the owner of the event will sync his calendar. opw-1966309 closes odoo/odoo#34075 Signed-off-by: Denis Ledoux --- addons/google_calendar/models/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/models/google_calendar.py b/addons/google_calendar/models/google_calendar.py index 3fd6042153d..aa553547c96 100644 --- a/addons/google_calendar/models/google_calendar.py +++ b/addons/google_calendar/models/google_calendar.py @@ -81,7 +81,7 @@ class SyncEvent(object): self.OP = Delete((self.OE.status and "OE") or (self.GG.status and "GG"), 'The event has been deleted from one side, we delete on other side !') #If event is not deleted ! - elif self.OE.status and (self.GG.status or not is_owner): + elif self.OE.status and (self.GG.status or (not is_owner and self.GG.update)): if abs(self.OE.update - self.GG.update) > timedelta(seconds=1): if self.OE.update < self.GG.update: tmpSrc = 'GG'