[FIX] google_calendar: missing part of caac19c1

Modify all references of google_attendee['email']
This commit is contained in:
Martin Trigaux 2015-07-22 12:22:35 +01:00
parent c0e24fc9ce
commit 9abf868948
1 changed files with 5 additions and 4 deletions

View File

@ -422,9 +422,10 @@ class google_calendar(osv.AbstractModel):
if self.get_need_synchro_attendee(cr, uid, context=context):
for google_attendee in single_event_dict.get('attendees', []):
partner_email = google_attendee.get('email', False)
if type == "write":
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)
google_attendee['found'] = True
continue
@ -432,12 +433,12 @@ class google_calendar(osv.AbstractModel):
if google_attendee.get('found'):
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:
data = {
'email': google_attendee.get('email', False),
'email': partner_email,
'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 = res_partner_obj.read(cr, uid, attendee_id[0], ['email'], context=context)