[FIX] google_calendar: force internal id only on creation

This rev. is related to 1c533b193f

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.
This commit is contained in:
Denis Ledoux 2015-09-01 17:36:52 +02:00
parent 1c533b193f
commit 3c0fe940aa
1 changed files with 4 additions and 3 deletions

View File

@ -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):