bzr revid: atp@tinyerp.com-20110329124137-naqhsatam8i80ghw
This commit is contained in:
Atul Patel (OpenERP) 2011-03-29 18:11:37 +05:30
parent 414f05c250
commit ecb51e033e
1 changed files with 7 additions and 7 deletions

View File

@ -111,15 +111,15 @@ def import_users(sugar_obj, cr, uid, context=None):
for val in sugar_data:
user_ids = user_obj.search(cr, uid, [('login', '=', val.get('user_name'))])
if user_ids:
return str(user_ids[0])
val['.id'] = str(user_ids[0])
else:
val['password'] = 'sugarcrm' #default password for all user
new_department_id = department_obj.create(cr, uid, {'name': val.get('department')})
val['context_department_id'] = new_department_id
val['context_lang'] = context.get('lang','en_US')
fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_user)
#All data has to be imported separatly because they don't have the same field
user_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context)
new_department_id = department_obj.create(cr, uid, {'name': val.get('department')})
val['context_department_id'] = new_department_id
val['context_lang'] = context.get('lang','en_US')
fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_user)
#All data has to be imported separatly because they don't have the same field
user_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context)
def get_lead_status(surgar_obj, cr, uid, sugar_val,context=None):
if not context: