summaryrefslogtreecommitdiff
path: root/addons/google_calendar/models/google_sync.py
AgeCommit message (Collapse)Author
2021-04-16[FIX] google_calendar: turn off notifications to improve perfs.Aurélien (avd)
Turn off calendar.attendees notification during synced_events creation to improve performances. The calendar notification are only computed once after all the synced events have been created. Add a flag in google_calendar.js to avoid retriggering synchronization while navigating the calendar view if the past synchronization is still pending.
2021-03-22[FIX] google_calendar: events sync issuesLucas Lefèvre
Before this commit: The google synchronization dis not properly synced event in some conditions. Some use cases were not properly tested. Recurrent events were regularly badly synchronized with Google. Several issues occured: - events not follow recurrence were duplicated on both Google or Odoo and sometimes deleted when the recurrence was reapplied. - the base_event (first event of the recurrence) was duplicated - miscalculation of the event google_id when they were part of a recurrence but did not followed the rrule. - improper data handling from google. Odoo objets were created with incorrect values - attendee state was not properly sync from Odoo to Google - whole recurrence deletions from google were not properly sync in Odoo - when time fields of a recurrence were modified on Google, modifications were ignored on Odoo - Event timezone were not properly saved on the recurrency. (Odoo saves it on the recurrency and Google on the event) - Odoo considered that all public events are writable bu Odoo users. That would trigger errors as Google implement an access right model on public events - lack of tests - a lot of weird behaviors resulting from these problems. closes odoo/odoo#66080 Taskid: 2456498 Opw: 2299834 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Co-authored-by: Lucas Lefèvre <lul@odoo.com> Co-authored-by: Arnaud Joset <arj@odoo.com>
2021-01-22[FIX] google_calendar: enable the event deletionAdrien Widart
When using the Calender synced with Google, if the user tries to delete an event, an error message is displayed: he has to archive it instead. To reproduce the error: 1. Sync Odoo Calendar with Gogle Calendar 2. Add an event 3. Click on it > Delete Error: UserError message: "You cannot delete a record synchronized with Google Calendar, archive it instead" To make the flow simpler and faster, when clicking on "Delete", the server will archive the event. When archiving an event, the server deletes the corresponding event on Google Calendar. As a result, the next time the user loads his Odoo Calendar, the sync Google->Odoo will delete the archived event. OPW-2440339 closes odoo/odoo#64874 Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-11-23[FIX]: google_calendar: check write_date when syncing with googleArnaud Joset
When the database is migrated from 13.3 to 14.0, the write_date is not set on the 'calendar.event' records. During the syncing with google api, the write-date is compared to take the more recent values, leading to an inevitable crash for recently migrated databases. closes odoo/odoo#62185 Taskid: 2389374 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-03[IMP] core: deprecate method cr.after()Raphael Collet
Use the more convenient `cr.postcommit.add()` instead. closes odoo/odoo#56990 Related: odoo/enterprise#12914 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-05-14[FIX] models.py: remove leftover `import crm` like compatibilityJulien Castiaux
Historically, it was possible to import addons via a naked import. It is no more possible since 9e1f13bac, since that commit, the only possible way to import odoo addons is via the `import odoo.addons' prefix. closes odoo/odoo#46995 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-09[REF] calendar: Lint + Clean codeYannick Tivisse
2020-04-09[REF] google_calendar: Refactor synchronisationLucas Lefèvre
This commit refactors calendar synchronization between Odoo and Google after the main calendar application refactoring. This refactoring takes advantage of two new features from the Google API: - New way of synchronizing resources efficiently[1] Incremental sync is performed repeatedly and updates Odoo with all the changes that happened ever since the previous sync. Each time, Odoo provides the previous sync token it obtained from Google and stores the new sync token from the response. - Event metadata[2] Ability to set hidden key-value pairs with an event, called extended properties. These extended properties are used to store the related odoo event id and the Odoo owner id (see known limitations) Known limitations ================= - Let A and B be two new users (no tokens available). A creates an event in Odoo and invites B. A is the owner of the event (user_id). Now B authenticates to his Google Calendar account and synchronizes his calendar. We cannot send the event to A's calendar since we don't have any access to his Google Calendar. Hence the event his sent to B's calendar. This leads to data de-synchronisation: The owner is A in Odoo but B in Google. The "real" owner (user A) is stored in the Google event's metadata to be able to reconcile the owner for following synchronizations. - Let A and B be two users of Odoo and Google Calendar. And let the Google Calendar of B be private (e.g. if A creates an event in Google Calendar and invites B, B won't see the event in his calendar). If A creates an event in Odoo and invites B. The event is synced to Google Calendar of A. Now B can see the event in Odoo but he can't see it in his Google Calendar. Task 2126717 PR #42031 PR Enterprise odoo/enterprise#8006 [1] https://developers.google.com/calendar/v3/sync [2] https://developers.google.com/calendar/extended-properties