[FIX] event_track_calendar_event: disable partner_ids from calendar events of event track to prevent unexpected notifications from google

This commit is contained in:
clementthomas
2025-01-10 10:39:02 +01:00
parent ddefa78b49
commit b8bc91f7bc

View File

@@ -25,9 +25,13 @@ class EventTrack(models.Model):
"""return default values of calendar events """return default values of calendar events
""" """
return { return {
'partner_ids':[Command.set(self.get_calendar_event_partner_value())], # due to google calendar unexpected notifications, for the moment we disable attendees of calendar event
# uncomment following line to re-enable
#'partner_ids':[Command.set(self.get_calendar_event_partner_value())],
'partner_ids':[Command.set([])],
'location':self.location_id.name if self.location_id else '', 'location':self.location_id.name if self.location_id else '',
'user_id':self.user_id.id #'user_id':self.user_id.id,
'privacy':"confidential"
} }
def get_calendar_event_partner_value(self): def get_calendar_event_partner_value(self):
@@ -71,3 +75,10 @@ class EventTrack(models.Model):
res = super().write(vals) res = super().write(vals)
self.sync_calendar_event() self.sync_calendar_event()
return res return res
def unlink(self):
for track in self:
for calendar_event in track.calendar_event_ids:
calendar_event.unlink()
return super(EventTrack, self).unlink()