From fd2518eecb1a189f997b442de1bd25e70d76ab8d Mon Sep 17 00:00:00 2001 From: Stan Date: Thu, 11 Jun 2015 13:55:10 +0200 Subject: [PATCH] [FIX] google_calendar: fail during first sync If an event exists on Google but was not synced yet in Odoo, the synchronisation would fail. When self.OE.found is False, self.OE.event is not defined and trying to access it would fail (it's a python object, not a recordset) Check the ownership after making sure the event is present in Odoo. Fixes #7034 --- addons/google_calendar/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 0616a87d331..a20143aff85 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -84,8 +84,8 @@ class SyncEvent(object): def compute_OP(self, modeFull=True): #If event are already in Gmail and in OpenERP - is_owner = self.OE.event.env.user.id == self.OE.event.user_id.id if self.OE.found and self.GG.found: + is_owner = self.OE.event.env.user.id == self.OE.event.user_id.id #If the event has been deleted from one side, we delete on other side ! if self.OE.status != self.GG.status and is_owner: self.OP = Delete((self.OE.status and "OE") or (self.GG.status and "GG"),