Files
odoo_source/addons/google_calendar/models
Arnaud Joset c654700291 [FIX] google_calendar: allow deletion of attendee with the same email
Before this commit, when a recurrent event would have several partners with the same email, a traceback would occurs:

```py
~/src/odoo/15.0/addons/google_calendar/models/calendar_recurrence_rule.py in _write_from_google(self, gevent, vals)
    111             if email_normalize(odoo_attendee_email) not in emails:
    112                 attendee = existing_attendees.exists().filtered(lambda att: att.email == email_normalize(odoo_attendee_email))
--> 113                 self.calendar_event_ids.write({'need_sync': False, 'partner_ids': [(3, attendee.partner_id.id)]})
    114
    115         # Update the recurrence values

~/src/odoo/15.0/odoo/fields.py in get(self, record, owner)
   4062         elif size == 1:
   4063             return ids[0]
-> 4064         raise ValueError("Expected singleton: %s" % record)
   4065
   4066     def set(self, record, value):
```

closes odoo/odoo#83040

X-original-commit: 670961cd8140143c6e5a82b37dd6030758165485
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-01-20 08:21:58 +00:00
..