[IMP]:change in google_contact

bzr revid: dbr@tinyerp.com-20110609105557-y4dkp2avrzl9zodt
This commit is contained in:
DBR (OpenERP) 2011-06-09 16:25:57 +05:30
parent ff45483f72
commit c6a69ccaf5
2 changed files with 6 additions and 7 deletions

View File

@ -346,11 +346,6 @@ class import_framework(Thread):
result = []
imported = set() #to invoid importing 2 times the sames modules
for table in self.table_list:
# try:
# to_import = self.get_mapping()[table].get('import', True)
# except:
# import traceback,sys
# info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
to_import = self.get_mapping()[table].get('import', True)
if not table in imported:
res = self._resolve_dependencies(self.get_mapping()[table].get('dependencies', []), imported)

View File

@ -271,6 +271,7 @@ class google_import(import_framework):
def get_contact(self):
contact=self.gclient
gclient=self.context.get('client',False)
table = self.context.get('table')[0]
datas = []
while contact:
for entry in contact.entry:
@ -282,6 +283,9 @@ class google_import(import_framework):
data['name'] = name
emails = ','.join(email.address for email in entry.email)
data['email'] = emails
if table == 'Contact':
data.update({'customer': str(self.context.get('customer')),
'supplier': str(self.context.get('supplier'))})
if entry.organization:
if entry.organization.org_name:
data.update({'company': entry.organization.org_name.text})
@ -321,8 +325,8 @@ class google_import(import_framework):
'dependencies': [],
'map': {
'name': 'name',
'customer': str(self.context.get('customer')),
'supplier': str(self.context.get('supplier')),
'customer': 'customer',
'supplier': 'supplier',
'address/id': self.get_partner_address,
}
}