diff --git a/addons/import_base/import_framework.py b/addons/import_base/import_framework.py index 8994e1568e6..8e930828206 100644 --- a/addons/import_base/import_framework.py +++ b/addons/import_base/import_framework.py @@ -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) diff --git a/addons/import_google/wizard/import_google.py b/addons/import_google/wizard/import_google.py index 31655da0025..9f6358aed21 100644 --- a/addons/import_google/wizard/import_google.py +++ b/addons/import_google/wizard/import_google.py @@ -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, } }