Skip to content

Commit

Permalink
[FIX] google_calendar: fix duplicate first event issue in google cale…
Browse files Browse the repository at this point in the history
…ndar

Steps to Reproduce:
- Install the calendar and Google Calendar.
- Sync with Google Calendar.
- Create an all-day event with recurrence.

Issue:
- The first event gets duplicated when created as an "All-day" event with
  recurrence.

Cause:
- The duplication occurs because when creating an all-day event with recurrence,
  two events are generated daily. However, during editing, one event may be
  mistakenly converted to a non-recurring event, resulting in apparent
  duplication.

Solution:
- To fix this, the google_insert method has been adjusted to insert an
  additional event in Google Calendar only when a recurrence condition is met,
  thereby preventing the duplication of the first event.

task-3768121
  • Loading branch information
nikj-odoo committed Apr 24, 2024
1 parent 783d92e commit c9cd9c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/google_calendar/models/google_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def write(self, vals):
self._event_ids_from_google_ids.clear_cache(self)
synced_fields = self._get_google_synced_fields()
if 'need_sync' not in vals and vals.keys() & synced_fields and not self.env.user.google_synchronization_stopped:
vals['need_sync'] = True
vals['need_sync'] = False

result = super().write(vals)
for record in self.filtered('need_sync'):
Expand Down

0 comments on commit c9cd9c1

Please sign in to comment.