[FIX] google_calendar: missing part of caac19c1
Modify all references of google_attendee['email']
This commit is contained in:
parent
c0e24fc9ce
commit
9abf868948
|
@ -422,9 +422,10 @@ class google_calendar(osv.AbstractModel):
|
||||||
|
|
||||||
if self.get_need_synchro_attendee(cr, uid, context=context):
|
if self.get_need_synchro_attendee(cr, uid, context=context):
|
||||||
for google_attendee in single_event_dict.get('attendees', []):
|
for google_attendee in single_event_dict.get('attendees', []):
|
||||||
|
partner_email = google_attendee.get('email', False)
|
||||||
if type == "write":
|
if type == "write":
|
||||||
for oe_attendee in event['attendee_ids']:
|
for oe_attendee in event['attendee_ids']:
|
||||||
if oe_attendee.email == google_attendee['email']:
|
if oe_attendee.email == partner_email:
|
||||||
calendar_attendee_obj.write(cr, uid, [oe_attendee.id], {'state': google_attendee['responseStatus'], 'google_internal_event_id': single_event_dict.get('id')}, context=context)
|
calendar_attendee_obj.write(cr, uid, [oe_attendee.id], {'state': google_attendee['responseStatus'], 'google_internal_event_id': single_event_dict.get('id')}, context=context)
|
||||||
google_attendee['found'] = True
|
google_attendee['found'] = True
|
||||||
continue
|
continue
|
||||||
|
@ -432,12 +433,12 @@ class google_calendar(osv.AbstractModel):
|
||||||
if google_attendee.get('found'):
|
if google_attendee.get('found'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
attendee_id = res_partner_obj.search(cr, uid, [('email', '=', google_attendee['email'])], context=context)
|
attendee_id = res_partner_obj.search(cr, uid, [('email', '=', partner_email)], context=context)
|
||||||
if not attendee_id:
|
if not attendee_id:
|
||||||
data = {
|
data = {
|
||||||
'email': google_attendee.get('email', False),
|
'email': partner_email,
|
||||||
'customer': False,
|
'customer': False,
|
||||||
'name': google_attendee.get("displayName", False) or google_attendee['email']
|
'name': google_attendee.get("displayName", False) or partner_email
|
||||||
}
|
}
|
||||||
attendee_id = [res_partner_obj.create(cr, uid, data, context=context)]
|
attendee_id = [res_partner_obj.create(cr, uid, data, context=context)]
|
||||||
attendee = res_partner_obj.read(cr, uid, attendee_id[0], ['email'], context=context)
|
attendee = res_partner_obj.read(cr, uid, attendee_id[0], ['email'], context=context)
|
||||||
|
|
Loading…
Reference in New Issue