From 815f91b9511c52b95177e2824ee913aaf80ee8d2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 2 Jun 2015 15:04:00 +0200 Subject: [PATCH] [FIX] google_calendar: remove event in google while being only attendee If User A created an event In Odoo, inviting User B, Then, if User A sync his calendar with Google, user B have an invitation to this event in Google, if user B refuses the event AND remove it from his Google calendar and then syncs his calendar to Odoo, the event was removed from the Odoo calendar, of all attendees. opw-641356 --- addons/google_calendar/google_calendar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index f443f9b2904..0616a87d331 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -84,13 +84,14 @@ 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: #If the event has been deleted from one side, we delete on other side ! - if self.OE.status != self.GG.status: + if self.OE.status != self.GG.status and is_owner: self.OP = Delete((self.OE.status and "OE") or (self.GG.status and "GG"), 'The event has been deleted from one side, we delete on other side !') #If event is not deleted ! - elif self.OE.status and self.GG.status: + elif self.OE.status and (self.GG.status or not is_owner): if self.OE.update.split('.')[0] != self.GG.update.split('.')[0]: if self.OE.update < self.GG.update: tmpSrc = 'GG'