From 4b26c8743afce698155942e676979bb76b5a49d7 Mon Sep 17 00:00:00 2001 From: "Sbh (OpenERP)" Date: Tue, 15 Feb 2011 13:01:11 +0530 Subject: [PATCH] [ADD] sync_google_contact: store contact id bzr revid: sbh@tinyerp.com-20110215073111-m6yb74bncx5uxwkn --- addons/sync_google_contact/sync_google_contact.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/sync_google_contact/sync_google_contact.py b/addons/sync_google_contact/sync_google_contact.py index 7ef2bff4d6c..da42618646f 100644 --- a/addons/sync_google_contact/sync_google_contact.py +++ b/addons/sync_google_contact/sync_google_contact.py @@ -78,12 +78,13 @@ class res_partner_address(osv.osv): def create(self, cr, uid, vals, context=None): - + id =super(res_partner_address, self).create(cr, uid, vals, context=context) + vals.update({'ids':id}) if context is None: context = {} if vals.get('sync_google') : self.sync_create(cr,uid,vals,context=context,synchronize=vals.get('sync_google')) - return super(res_partner_address, self).create(cr, uid, vals, context=context) + return id def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if context is None: @@ -98,7 +99,9 @@ class res_partner_address(osv.osv): google_obj =google_lib(gmail_user, gamil_pwd) name=vals.get('name') email=vals.get('email') - contact = google_obj._create_contact(name,email) + contact = google_obj._create_contact(name,email) + openerp_id=vals['ids'] + self.write(cr,uid,[openerp_id],{'google_id':contact.id.text},context=context) return True res_partner_address()