From 07f17b0c806d8fd97ec087440c2242525795caf0 Mon Sep 17 00:00:00 2001 From: "Gabriel de Paula Felix (gdpf)" Date: Fri, 1 Sep 2023 15:53:24 -0300 Subject: [PATCH] [FIX] microsoft_calendar: traceback restarting synchronizations Before this commit, when restarting a synchronization with Outlook or Google, a traceback error could be thrown due when accessing a variable possibly null. After this commit, the variable integrity is checked before its access. Issue from: 3473180 closes odoo/odoo#134181 X-original-commit: e7015b6c0cd2bd009184bfbc69730c211922658b Signed-off-by: Arnaud Joset (arj) Signed-off-by: Gabriel de Paula Felix (gdpf) --- addons/microsoft_calendar/models/calendar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/microsoft_calendar/models/calendar.py b/addons/microsoft_calendar/models/calendar.py index 2bbbd4be589..c7235002d4e 100644 --- a/addons/microsoft_calendar/models/calendar.py +++ b/addons/microsoft_calendar/models/calendar.py @@ -142,7 +142,8 @@ class Meeting(models.Model): # Forbid recurrence updates through Odoo and suggest user to update it in Outlook. if self._check_microsoft_sync_status(): recurrency_in_batch = self.filtered(lambda ev: ev.recurrency) - if not notify_context and (recurrence_update_setting or 'recurrency' in values or recurrency_in_batch): + recurrence_update_attempt = recurrence_update_setting or 'recurrency' in values or recurrency_in_batch and len(recurrency_in_batch) > 0 + if not notify_context and recurrence_update_attempt and not 'active' in values: self._forbid_recurrence_update() # check a Outlook limitation in overlapping the actual recurrence