From 006dff00ce53888175345651f818d45fa005fe73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Tue, 17 Jan 2017 15:18:03 +0100 Subject: [PATCH] [FIX] google_calendar: correct previous fix, and set correct context The first fix (de21eda9f45638ab8f1c9328b0de1b06c128677f) was not enough ... --- addons/google_calendar/models/google_calendar.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/google_calendar/models/google_calendar.py b/addons/google_calendar/models/google_calendar.py index 007bbffeaf9..fb2e2e4f611 100644 --- a/addons/google_calendar/models/google_calendar.py +++ b/addons/google_calendar/models/google_calendar.py @@ -795,6 +795,7 @@ class GoogleCalendar(models.AbstractModel): actToDo = event.OP actSrc = event.OP.src + # To avoid redefining 'self', all method below should use 'recs' instead of 'self' recs = self.with_context(curr_attendee=event.OE.attendee_id) if isinstance(actToDo, NothingToDo): @@ -828,12 +829,9 @@ class GoogleCalendar(models.AbstractModel): if event_to_synchronize[base_event][0][1].OE.event_id: parent_event['id'] = "%s-%s" % (event_to_synchronize[base_event][0][1].OE.event_id, new_google_event_id) - res = self.update_from_google(parent_event, event.GG.event, "copy") + res = recs.update_from_google(parent_event, event.GG.event, "copy") else: - self.create_from_google(event, my_partner_id) - - parent_event['id'] = "%s-%s" % (event_to_synchronize[base_event][0][1].OE.event_id, new_google_event_id) - res = recs.update_from_google(parent_event, event.GG.event, "copy") + recs.create_from_google(event, my_partner_id) else: parent_oe_id = event_to_synchronize[base_event][0][1].OE.event_id if parent_oe_id: