From 3c0fe940aa5f91a4ed45cf2fa96fb11c079c5733 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 1 Sep 2015 17:36:52 +0200 Subject: [PATCH] [FIX] google_calendar: force internal id only on creation This rev. is related to 1c533b193feb7629d87ab1ff740b0cbc7615812e The reason why we force the event Google internal id is explained in the above commit. Forcing the internal id must be done only when creating the event in Google, not when updating, for retro-compatibility: if the event is already in the attendee calendar, with a different internal id then the other attendee, we must leave it like this, otherwise Google will be lost. --- addons/google_calendar/google_calendar.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 72325e39c76..fb7dd0dfa6a 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -259,9 +259,10 @@ class google_calendar(osv.AbstractModel): if not self.get_need_synchro_attendee(cr, uid, context=context): data.pop("attendees") - other_google_ids = [other_att.google_internal_event_id for other_att in event.attendee_ids if other_att.google_internal_event_id] - if other_google_ids: - data["id"] = other_google_ids[0] + if isCreating: + other_google_ids = [other_att.google_internal_event_id for other_att in event.attendee_ids if other_att.google_internal_event_id] + if other_google_ids: + data["id"] = other_google_ids[0] return data def create_an_event(self, cr, uid, event, context=None):