From 846367530af3206d856e03b55bcfa91a88d8a4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Baranx=20=28bar=29?= Date: Fri, 19 Nov 2021 09:24:38 +0000 Subject: [PATCH] [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 --- addons/google_calendar/utils/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/utils/google_calendar.py b/addons/google_calendar/utils/google_calendar.py index f1abb8cb4be..8e81fb532e0 100644 --- a/addons/google_calendar/utils/google_calendar.py +++ b/addons/google_calendar/utils/google_calendar.py @@ -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):