From b0bc3d08147c04e71e131baf3cf947b038d5c4cf Mon Sep 17 00:00:00 2001 From: Maitri Patel Date: Mon, 7 Aug 2023 19:02:42 +0530 Subject: [PATCH] [FIX] calendar: handle singleton exception for sync calendar event This error occurs when recurrence_id has no records when the user tries to delete the sync calendar which has recurrent events. Error: 'Expected singleton: calendar.recurrence()' See- https://github.com/odoo/odoo/blob/15.0/addons/calendar/models/calendar_event.py#L715 sentry-4367276387 closes odoo/odoo#134438 X-original-commit: 6ba4a671c4b37120146f137f88363dd5b170562f Signed-off-by: Arnaud Joset (arj) --- addons/calendar/models/calendar_event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/calendar/models/calendar_event.py b/addons/calendar/models/calendar_event.py index d0bab630603..b85df7eaf7a 100644 --- a/addons/calendar/models/calendar_event.py +++ b/addons/calendar/models/calendar_event.py @@ -900,7 +900,7 @@ class Meeting(models.Model): self.ensure_one() if recurrence_update_setting == 'all_events': self.recurrence_id.calendar_event_ids.write({'active': False}) - elif recurrence_update_setting == 'future_events': + elif recurrence_update_setting == 'future_events' and self.recurrence_id: detached_events = self.recurrence_id._stop_at(self) detached_events.write({'active': False}) elif recurrence_update_setting == 'self_only':