From fb6b959feffcd216b1c4bb349aa44a04b5f9f429 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Fri, 8 Apr 2022 11:09:26 +0000 Subject: [PATCH] [FIX] microsoft_calendar: sync events without body property Before this commit: if a Microsoft event didn't have body property, it couldn't get synced with Odoo and raised an error. The solution is first to check if it contains the body and then gets its content value. opw-2765443 closes odoo/odoo#89634 X-original-commit: 13d57ff5e714bee96fb930c1b8050816bf22c268 Signed-off-by: Arnaud Joset Signed-off-by: Pedram Bi Ria (pebr) --- addons/microsoft_calendar/models/calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microsoft_calendar/models/calendar.py b/addons/microsoft_calendar/models/calendar.py index 60012a4b45b..29421e9dfc9 100644 --- a/addons/microsoft_calendar/models/calendar.py +++ b/addons/microsoft_calendar/models/calendar.py @@ -106,7 +106,7 @@ class Meeting(models.Model): values = { **default_values, 'name': microsoft_event.subject or _("(No title)"), - 'description': microsoft_event.body['content'], + 'description': microsoft_event.body and microsoft_event.body['content'], 'location': microsoft_event.location and microsoft_event.location.get('displayName') or False, 'user_id': microsoft_event.owner(self.env).id, 'privacy': sensitivity_o2m.get(microsoft_event.sensitivity, self.default_get(['privacy'])['privacy']),