From f43995eab852593c96d897d0fa4bfc8dc48b8672 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Tue, 29 Mar 2022 12:20:19 +0000 Subject: [PATCH] [FIX] google_calendar: Prevent resyncing of synced recurrence events Before this commit: When you sync the Odoo calendar with Google for the first time, it will resync all of the created recurrence events with Google after fetching all of the Google events. The problem is that it chooses the 'accepted' state by default for the current user's state. If you were invited to events and you hadn't accepted that, it would update your status and send an email per event for all attendees. Steps to reproduce the issue: 1. Create two new google accounts ( you'll bombard with emails) 2. Create a recurrent event without ending with the first account and choose the second account as a guest.(don't accept) 3. Sync second account with Odoo => It'll send about 700 emails The solution is to prevent synced recurrence events from syncing and. opw-2691146 closes odoo/odoo#89633 X-original-commit: 084aeb239e85a4e3abb3e233af68c6838dfbb3d7 Signed-off-by: Arnaud Joset --- addons/google_calendar/models/res_users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/google_calendar/models/res_users.py b/addons/google_calendar/models/res_users.py index e0c56916207..b420dc05f6a 100644 --- a/addons/google_calendar/models/res_users.py +++ b/addons/google_calendar/models/res_users.py @@ -73,6 +73,7 @@ class User(models.Model): recurrences -= synced_recurrences recurrences._sync_odoo2google(calendar_service) synced_events |= recurrences.calendar_event_ids - recurrences._get_outliers() + synced_events |= synced_recurrences.calendar_event_ids - synced_recurrences._get_outliers() events = self.env['calendar.event']._get_records_to_sync(full_sync=full_sync) (events - synced_events)._sync_odoo2google(calendar_service)