[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
This commit is contained in:
Stan 2015-06-11 13:55:10 +02:00 committed by Martin Trigaux
parent ec18bf6f44
commit fd2518eecb
1 changed files with 1 additions and 1 deletions

View File

@ -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"),