[FIX] google_calendar: force notification sending

Suppose both Google Calendar and Odoo Calendar are synced. Google will
not send any invitation to attendees when the user creates an event from
Odoo.

This fix requires Google to notify attendees when an event is created,
modified or cancelled.

OPW-2501413

closes odoo/odoo#69735

X-original-commit: 48cc3ed28e51ce34c1740f9b394d971234e0bdbe
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
This commit is contained in:
Adrien Widart
2021-04-23 09:10:40 +00:00
parent b27614b136
commit b6fc91d243
@@ -67,7 +67,7 @@ class GoogleCalendarService():
@requires_auth_token
def insert(self, values, token=None, timeout=TIMEOUT):
url = "/calendar/v3/calendars/primary/events"
url = "/calendar/v3/calendars/primary/events?sendUpdates=all"
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token}
if not values.get('id'):
values['id'] = uuid4().hex
@@ -76,13 +76,13 @@ class GoogleCalendarService():
@requires_auth_token
def patch(self, event_id, values, token=None, timeout=TIMEOUT):
url = "/calendar/v3/calendars/primary/events/%s" % event_id
url = "/calendar/v3/calendars/primary/events/%s?sendUpdates=all" % event_id
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token}
self.google_service._do_request(url, json.dumps(values), headers, method='PUT', timeout=timeout)
@requires_auth_token
def delete(self, event_id, token=None, timeout=TIMEOUT):
url = "/calendar/v3/calendars/primary/events/%s" % event_id
url = "/calendar/v3/calendars/primary/events/%s?sendUpdates=all" % event_id
headers = {'Content-type': 'application/json'}
params = {'access_token': token}
try: