[FIX] google_calendar: empty event name in google calendar

As explained at https://github.com/odoo/odoo/blob/171e42e380a46463b4359166955dc4c5f6ccf42e/addons/google_calendar/models/calendar.py#L206,
When there is no Odoo user who is the owner of the updated event,
modification are limited to some fields only.

In this case, that means we must use the `PATCH` method instead of the `PUT`
one to avoid erasing all not modified fields such the event name.

opw-2694739

closes odoo/odoo#81341

X-original-commit: 960e63a75350c28f186e55d69bffea6d51dcf7f1
Signed-off-by: Arnaud Joset <arj@odoo.com>
This commit is contained in:
Rémy Baranx (bar)
2021-12-17 10:10:49 +00:00
parent bec3c58df3
commit 846367530a
@@ -78,7 +78,7 @@ class GoogleCalendarService():
def patch(self, event_id, values, token=None, timeout=TIMEOUT):
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)
self.google_service._do_request(url, json.dumps(values), headers, method='PATCH', timeout=timeout)
@requires_auth_token
def delete(self, event_id, token=None, timeout=TIMEOUT):