[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 <beledouxdenis@users.noreply.github.com>
This commit is contained in:
Abridbus
2019-06-13 08:17:33 +00:00
committed by Denis Ledoux
parent 115ae7f894
commit 648a3af3ca
@@ -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'