[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) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
This commit is contained in:
Gabriel de Paula Felix (gdpf)
2023-09-04 19:58:31 +00:00
parent 602b3f3d39
commit 07f17b0c80
+2 -1
View File
@@ -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