Skip to content
Permalink
Browse files

[FIX] google_calendar: case insensitive attendee sync

In Odoo, create a user John@example.com (the cap is on purpose)
In Google Calendar, create an event and invite john@example.com

Sync your Google calendar.

Before this revision,
the event created in Odoo did not add John@example.com,
but created a new attendee, john@example.com, because
of the sensitive casing.

Besides, give the priority to partners having
users, so if there are two partners with the same email,
one of them having a user,
e.g. John@example.com (with user) & john@example.com (without user),
set the partner having the user as attendee,
as its the one with the user who use the Odoo calendar,
and potentially the Google sync as well.

opw-1925592

closes #31111
  • Loading branch information...
beledouxdenis committed Feb 14, 2019
1 parent cd3790c commit 69719f598aad2eb8ff87687bc47900030688f0ce
Showing with 3 additions and 1 deletion.
  1. +3 −1 addons/google_calendar/models/google_calendar.py
@@ -443,7 +443,9 @@ def update_from_google(self, event, single_event_dict, type):
if google_attendee.get('found'):
continue

attendee = ResPartner.search([('email', '=', google_attendee['email'])], limit=1)
attendee = ResPartner.search([('email', '=ilike', google_attendee['email']), ('user_ids', '!=', False)], limit=1)
if not attendee:
attendee = ResPartner.search([('email', '=ilike', google_attendee['email'])], limit=1)
if not attendee:
data = {
'email': partner_email,

0 comments on commit 69719f5

Please sign in to comment.
You can’t perform that action at this time.