From 3c911ec0936b03f924ccb58820a49e4a3180734f Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 29 Mar 2011 10:04:57 +0530 Subject: [PATCH 01/10] [FIX]: Optimize code and Correct "Customer" and "Supplier" partner problem in sugarcrm data for partner. bzr revid: atp@tinyerp.com-20110329043457-exg4k4xjkva3g1i4 --- addons/import_sugarcrm/import_sugarcrm.py | 114 +++++++++------------- 1 file changed, 46 insertions(+), 68 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index cb56f71bdaa..48ac480ac1a 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -22,6 +22,7 @@ from osv import fields, osv from operator import itemgetter import sugar import sugarcrm_fields_mapping +from tools.translate import _ import pprint pp = pprint.PrettyPrinter(indent=4) @@ -90,8 +91,6 @@ def import_partner_address(sugar_obj, cr, uid, context=None): val['state_id/.id'] = state and state[0][0] or False fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) address_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) - - def import_users(sugar_obj, cr, uid, context=None): if not context: @@ -177,56 +176,6 @@ def get_opportunity_status(surgar_obj, cr, uid, sugar_val,context=None): stage_id = stage.id return stage_id -def get_billing_address(sugar_obj,cr, uid, val, map_partner_address, context=None): - fields=[] - datas=[] - - address_obj = sugar_obj.pool.get('res.partner.address') - res_country_obj = sugar_obj.pool.get('res.country') - str = val.get('billing_address_country')[0:2] - map_partner_address.update({ - 'street': 'billing_address_street', - 'zip': 'billing_address_postalcode', - 'city': 'billing_address_city', - 'country_id': 'country_id', - 'type': 'type' - }) - val['type'] = 'invoice' - country = get_all_countries(sugar_obj,cr, uid, val.get('billing_address_country'), context) - state = get_all_states(sugar_obj, cr, uid, val.get('billing_address_state'), context) - #Need to Fix bcz code create problem. - val['country_id'] = country and country[0][0] or res_country_obj.create(cr, uid, {'name': val.get('billing_address_country'), 'code': str}), - val['state_id'] = state and state[0][0] or False, - fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) - dict_val = dict(zip(fields,datas)) - new_address_id = address_obj.create(cr,uid, dict_val) - - return new_address_id - -def get_shipping_address(sugar_obj,cr, uid, val, map_partner_address, context=None): - fields=[] - datas=[] - str = '' - address_obj = sugar_obj.pool.get('res.partner.address') - res_country_obj = sugar_obj.pool.get('res.country') - str = val.get('shipping_address_country')[0:2] - map_partner_address.update({ - 'street': 'shipping_address_street', - 'zip': 'shipping_address_postalcode', - 'city': 'shipping_address_city', - 'country_id': 'country_id', - 'type': 'type' - }) - val['type'] = 'delivery' - country = get_all_countries(sugar_obj, cr, uid, val.get('shipping_address_country'), context) - state = get_all_states(sugar_obj, cr, uid, val.get('shipping_address_state'), context) - val['country_id'] = country and country[0][0] or res_country_obj.create(cr, uid, {'name': val.get('shipping_address_country'), 'code': str}), - val['state_id'] = state and state[0][0] or False, - fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) - dict_val = dict(zip(fields,datas)) - new_address_id = address_obj.create(cr,uid, dict_val) - return new_address_id - def get_user_address(sugar_obj, cr, uid, val, context=None): address_obj = sugar_obj.pool.get('res.partner.address') @@ -249,13 +198,40 @@ def get_user_address(sugar_obj, cr, uid, val, context=None): new_address_id = address_obj.create(cr,uid, dict_val) return new_address_id +def get_address_type(sugar_obj, cr, uid, val, map_partner_address, type, context=None): + address_obj = sugar_obj.pool.get('res.partner.address') + res_country_obj = sugar_obj.pool.get('res.country') + new_address_id = False + if type == 'invoice': + type_address = 'billing' + else: + type_address = 'shipping' + + map_partner_address.update({ + 'street': type_address + '_address_street', + 'zip': type_address +'_address_postalcode', + 'city': type_address +'_address_city', + 'country_id': 'country_id', + 'type': 'type', + }) + val['type'] = type + str = val.get(type_address +'_address_country')[0:2] + country = get_all_countries(sugar_obj, cr, uid, val.get(type_address +'_address_country'), context) + state = get_all_states(sugar_obj, cr, uid, val.get(type_address +'_address_state'), context) + val['country_id'] = country and country[0][0] or res_country_obj.create(cr, uid, {'name': val.get(type_address +'_address_country'), 'code': str}), + val['state_id'] = state and state[0][0] or False, + fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) + #Convert To list into Dictionary(Key, val). value pair. + dict_val = dict(zip(fields,datas)) + new_address_id = address_obj.create(cr,uid, dict_val) + return new_address_id + def get_address(sugar_obj, cr, uid, val, context=None): map_partner_address={} address_id=[] fields=[] datas=[] address_obj = sugar_obj.pool.get('res.partner.address') - model_obj = sugar_obj.pool.get('ir.model.data') address_ids = address_obj.search(cr, uid, [('name', '=',val.get('name')), ('type', 'in', ('invoice', 'delivery')), ('street', '=', val.get('billing_address_street'))]) if address_ids: return address_ids @@ -269,8 +245,11 @@ def get_address(sugar_obj, cr, uid, val, context=None): 'fax': 'phone_fax', 'type': 'type', } - address_id.append(get_billing_address(sugar_obj,cr, uid, val, map_partner_address, context)) - address_id.append(get_shipping_address(sugar_obj,cr, uid, val, map_partner_address, context)) + if val.get('billing_address_street'): + address_id.append(get_address_type(sugar_obj, cr, uid, val, map_partner_address, 'invoice', context)) + + if val.get('shipping_address_street'): + address_id.append(get_address_type(sugar_obj, cr, uid, val, map_partner_address, 'delivery', context)) return address_id def import_partners(sugar_obj, cr, uid, context=None): @@ -283,8 +262,8 @@ def import_partners(sugar_obj, cr, uid, context=None): 'user_id/id': 'assigned_user_id', 'ref': 'sic_code', 'comment': ['description', 'employees', 'ownership', 'annual_revenue', 'rating', 'industry', 'ticker_symbol'], - 'customer': False, - 'supplier': False + 'customer': 'customer', + 'supplier': 'supplier', } partner_obj = sugar_obj.pool.get('res.partner') @@ -294,16 +273,16 @@ def import_partners(sugar_obj, cr, uid, context=None): for val in sugar_data: add_id = get_address(sugar_obj, cr, uid, val, context) - if val.get('account_type') in ('customer', 'prospect', 'other'): - val['customer'] = True + if val.get('account_type') in ('Customer', 'Prospect', 'Other'): + val['customer'] = '1' else: - val['supplier'] = True + val['supplier'] = '1' fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner) partner_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) - for a in address_obj.browse(cr,uid,add_id): - data_id=partner_obj.search(cr,uid,[('name','like',a.name),('website','like',val.get('website'))]) + for address in address_obj.browse(cr,uid,add_id): + data_id = partner_obj.search(cr,uid,[('name','like',address.name),('website','like',val.get('website'))]) if data_id: - address_obj.write(cr,uid,a.id,{'partner_id':data_id[0]}) + address_obj.write(cr,uid,address.id,{'partner_id':data_id[0]}) return True @@ -405,6 +384,9 @@ def import_opportunities(sugar_obj, cr, uid, context=None): PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Opportunities') for val in sugar_data: + partner_xml_id = find_mapped_id(sugar_obj, cr, uid, 'res.partner', val.get('id'), context) + if not partner_xml_id: + raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) val['type'] = 'opportunity' stage_id = get_opportunity_status(sugar_obj, cr, uid, val, context) val['stage_id.id'] = stage_id @@ -444,8 +426,7 @@ MAP_FIELDS = {'Opportunities': #Object Mapping name class import_sugarcrm(osv.osv): """Import SugarCRM DATA""" - - + _name = "import.sugarcrm" _description = __doc__ _columns = { @@ -485,8 +466,6 @@ class import_sugarcrm(osv.osv): key_list.append('Accounts') if current.employee: key_list.append('Employees') - - return key_list def import_all(self, cr, uid, ids, context=None): @@ -501,7 +480,6 @@ class import_sugarcrm(osv.osv): MAP_FIELDS[key]['process'](self, cr, uid, context) imported.add(key) - obj_model = self.pool.get('ir.model.data') model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','import.message.form')]) resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id']) From 94a9c6f3f4ff937275b40d5718cb1dc569c08ede Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 29 Mar 2011 12:15:41 +0530 Subject: [PATCH 02/10] [FIX]: raise exception for partner name. bzr revid: atp@tinyerp.com-20110329064541-s2s3ic2lc5huc6bl --- addons/import_sugarcrm/import_sugarcrm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 48ac480ac1a..19d68cc5f83 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -381,12 +381,13 @@ def import_opportunities(sugar_obj, cr, uid, context=None): 'type' : 'type', } lead_obj = sugar_obj.pool.get('crm.lead') + partner_obj = sugar_obj.pool.get('res.partner') PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Opportunities') for val in sugar_data: - partner_xml_id = find_mapped_id(sugar_obj, cr, uid, 'res.partner', val.get('id'), context) + partner_xml_id = partner_obj.search(cr, uid, [('name', 'like', val.get('account_name'))]) if not partner_xml_id: - raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) + raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) val['type'] = 'opportunity' stage_id = get_opportunity_status(sugar_obj, cr, uid, val, context) val['stage_id.id'] = stage_id From 414f05c250e34eeea6361601ec53be48b2329fbb Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 29 Mar 2011 17:23:57 +0530 Subject: [PATCH 03/10] [IMP]: Add some fields and fix duplicate key problem for user. bzr revid: atp@tinyerp.com-20110329115357-g6l2704snzzam8gq --- addons/import_sugarcrm/import_sugarcrm.py | 43 +++++++++++++---------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 19d68cc5f83..724107a8569 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -102,7 +102,7 @@ def import_users(sugar_obj, cr, uid, context=None): 'context_lang' : 'context_lang', 'password' : 'password', '.id' : '.id', - 'context_department_id': 'department' + 'context_department_id': 'department', } user_obj = sugar_obj.pool.get('res.users') department_obj = sugar_obj.pool.get('hr.department') @@ -111,16 +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: - val['.id'] = str(user_ids[0]) + return str(user_ids[0]) else: val['password'] = 'sugarcrm' #default password for all user -# cr.execute('SELECT * FROM users_signatures u LIMIT 0,1000') - 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: @@ -229,8 +228,6 @@ def get_address_type(sugar_obj, cr, uid, val, map_partner_address, type, context def get_address(sugar_obj, cr, uid, val, context=None): map_partner_address={} address_id=[] - fields=[] - datas=[] address_obj = sugar_obj.pool.get('res.partner.address') address_ids = address_obj.search(cr, uid, [('name', '=',val.get('name')), ('type', 'in', ('invoice', 'delivery')), ('street', '=', val.get('billing_address_street'))]) if address_ids: @@ -265,7 +262,6 @@ def import_partners(sugar_obj, cr, uid, context=None): 'customer': 'customer', 'supplier': 'supplier', } - partner_obj = sugar_obj.pool.get('res.partner') address_obj = sugar_obj.pool.get('res.partner.address') PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) @@ -303,12 +299,12 @@ def import_resources(sugar_obj, cr, uid, context=None): def import_employees(sugar_obj, cr, uid, context=None): if not context: context = {} - map_employee = {'id' : 'user_hash', + map_employee = {'id' : 'id', + 'resource_id/.id': 'resource_id/.id', 'name': ['first_name', 'last_name'], 'work_phone': 'phone_work', 'mobile_phone': 'phone_mobile', 'user_id/name': ['first_name', 'last_name'], - 'resource_id/.id': 'resource_id/.id', 'address_home_id/.id': 'address_home_id/.id', 'notes': 'description', #TODO: Creation of Employee create problem. @@ -322,7 +318,7 @@ def import_employees(sugar_obj, cr, uid, context=None): for val in sugar_data: address_id = get_user_address(sugar_obj, cr, uid, val, context) val['address_home_id/.id'] = address_id - model_ids = find_mapped_id(sugar_obj, cr, uid, 'resource.resource', val.get('user_hash')+ '_resource_resource', context) + model_ids = find_mapped_id(sugar_obj, cr, uid, 'resource.resource', val.get('id')+ '_resource_resource', context) resource_id = sugar_obj.pool.get('ir.model.data').browse(cr, uid, model_ids) if resource_id: val['resource_id/.id'] = resource_id[0].res_id @@ -339,13 +335,15 @@ def import_leads(sugar_obj, cr, uid, context=None): 'id' : 'id', 'name': ['first_name', 'last_name'], 'contact_name': ['first_name', 'last_name'], - 'description': 'description', + 'description': ['description', 'refered_by', 'lead_source', 'lead_source_description', 'website'], 'partner_name': 'account_name', 'email_from': 'email1', 'phone': 'phone_work', 'mobile': 'phone_mobile', + 'title': 'salutation', 'function':'title', 'street': 'primary_address_street', + 'street2': 'alt_address_street', 'zip': 'primary_address_postalcode', 'city':'primary_address_city', 'user_id/id' : 'assigned_user_id', @@ -368,26 +366,35 @@ def import_leads(sugar_obj, cr, uid, context=None): def import_opportunities(sugar_obj, cr, uid, context=None): if not context: context = {} + categ_id = False map_opportunity = {'id' : 'id', 'name': 'name', 'probability': 'probability', 'partner_id/name': 'account_name', 'title_action': 'next_step', 'partner_address_id/name': 'account_name', - 'planned_revenue': 'amount_usdollar', + 'planned_revenue': 'amount', 'date_deadline':'date_closed', 'user_id/id' : 'assigned_user_id', 'stage_id.id' : 'stage_id.id', 'type' : 'type', + 'categ_id': 'opportunity_type' } lead_obj = sugar_obj.pool.get('crm.lead') partner_obj = sugar_obj.pool.get('res.partner') + categ_obj = sugar_obj.pool.get('crm.case.categ') PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Opportunities') for val in sugar_data: partner_xml_id = partner_obj.search(cr, uid, [('name', 'like', val.get('account_name'))]) if not partner_xml_id: - raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) + raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) + categ_ids = categ_obj.search(cr, uid, [('object_id.model','=','crm.lead'), ('name', 'like',val.get('opportunity_type'))]) + if categ_ids: + categ_id = categ_ids[0] + else: + categ_id = categ_obj.create(cr, uid, {'name': val.get('opportunity_type'), 'object_id.model': 'crm.lead'}) + val['categ_id'] = categ_id val['type'] = 'opportunity' stage_id = get_opportunity_status(sugar_obj, cr, uid, val, context) val['stage_id.id'] = stage_id From ecb51e033ee630f76bf0f4596851ac00c80203b1 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 29 Mar 2011 18:11:37 +0530 Subject: [PATCH 04/10] [FIX] bzr revid: atp@tinyerp.com-20110329124137-naqhsatam8i80ghw --- addons/import_sugarcrm/import_sugarcrm.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 724107a8569..c0f4d1dfca1 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -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: From 4686230d41af8d76f69f488e838977724087ba96 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Wed, 30 Mar 2011 12:13:42 +0530 Subject: [PATCH 05/10] [ADD]: Add title in Leads form bzr revid: atp@tinyerp.com-20110330064342-cv8atay7ykshg2no --- addons/import_sugarcrm/import_sugarcrm.py | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index c0f4d1dfca1..efe9e70ccbf 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -24,6 +24,7 @@ import sugar import sugarcrm_fields_mapping from tools.translate import _ import pprint +import tools pp = pprint.PrettyPrinter(indent=4) def create_mapping(obj, cr, uid, res_model, open_id, sugar_id, context): @@ -102,7 +103,7 @@ def import_users(sugar_obj, cr, uid, context=None): 'context_lang' : 'context_lang', 'password' : 'password', '.id' : '.id', - 'context_department_id': 'department', + 'context_department_id.id': 'context_department_id.id', } user_obj = sugar_obj.pool.get('res.users') department_obj = sugar_obj.pool.get('hr.department') @@ -115,7 +116,7 @@ def import_users(sugar_obj, cr, uid, context=None): 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_department_id.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 @@ -266,7 +267,6 @@ def import_partners(sugar_obj, cr, uid, context=None): address_obj = sugar_obj.pool.get('res.partner.address') PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Accounts') - for val in sugar_data: add_id = get_address(sugar_obj, cr, uid, val, context) if val.get('account_type') in ('Customer', 'Prospect', 'Other'): @@ -327,10 +327,23 @@ def import_employees(sugar_obj, cr, uid, context=None): fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_employee) employee_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) +def get_contact_title(sugar_obj, cr, uid, salutation, domain, context=None): + if not context: + context = {} + contact_title_obj = sugar_obj.pool.get('res.partner.title') + title_id = False + title_ids = contact_title_obj.search(cr, uid, [('shortcut', '=', salutation), ('domain', '=', domain)]) + if title_ids: + title_id = title_ids[0] + elif salutation: + title_id = contact_title_obj.create(cr, uid, {'name': salutation, 'shortcut': salutation, 'domain': domain}) + return title_id + def import_leads(sugar_obj, cr, uid, context=None): if not context: context = {} + title_id = False map_lead = { 'id' : 'id', 'name': ['first_name', 'last_name'], @@ -340,7 +353,7 @@ def import_leads(sugar_obj, cr, uid, context=None): 'email_from': 'email1', 'phone': 'phone_work', 'mobile': 'phone_mobile', - 'title': 'salutation', + 'title.id': 'title.id', 'function':'title', 'street': 'primary_address_street', 'street2': 'alt_address_street', @@ -356,6 +369,8 @@ def import_leads(sugar_obj, cr, uid, context=None): PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Leads') for val in sugar_data: + title_id = get_contact_title(sugar_obj, cr, uid, val.get('salutation'), 'contact', context) + val['title.id'] = title_id val['type'] = 'lead' stage_id = get_lead_status(sugar_obj, cr, uid, val, context) val['stage_id.id'] = stage_id @@ -378,7 +393,7 @@ def import_opportunities(sugar_obj, cr, uid, context=None): 'user_id/id' : 'assigned_user_id', 'stage_id.id' : 'stage_id.id', 'type' : 'type', - 'categ_id': 'opportunity_type' + 'categ_id.id': 'categ_id.id' } lead_obj = sugar_obj.pool.get('crm.lead') partner_obj = sugar_obj.pool.get('res.partner') @@ -394,7 +409,7 @@ def import_opportunities(sugar_obj, cr, uid, context=None): categ_id = categ_ids[0] else: categ_id = categ_obj.create(cr, uid, {'name': val.get('opportunity_type'), 'object_id.model': 'crm.lead'}) - val['categ_id'] = categ_id + val['categ_id.id'] = categ_id val['type'] = 'opportunity' stage_id = get_opportunity_status(sugar_obj, cr, uid, val, context) val['stage_id.id'] = stage_id From 99d219fd0db0c928fa8465f373ec999a56a838c3 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Wed, 30 Mar 2011 12:59:13 +0530 Subject: [PATCH 06/10] [IMP]: Minor Improvement. bzr revid: atp@tinyerp.com-20110330072913-lnk5jnhckrky1fy9 --- addons/import_sugarcrm/import_sugarcrm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index efe9e70ccbf..59f7555b329 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -285,7 +285,7 @@ def import_partners(sugar_obj, cr, uid, context=None): def import_resources(sugar_obj, cr, uid, context=None): if not context: context = {} - map_resource = {'id' : 'user_hash', + map_resource = {'id' : 'id', 'name': ['first_name', 'last_name'], } resource_obj = sugar_obj.pool.get('resource.resource') From a225c2a60fc80ebf3a90780c31a21aff3ad4ce18 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Thu, 31 Mar 2011 19:32:39 +0530 Subject: [PATCH 07/10] [ADD]: Add opportunity contacts in sugarcrm bzr revid: atp@tinyerp.com-20110331140239-ra9bbt3slju3yhsd --- addons/import_sugarcrm/import_sugarcrm.py | 108 +++++++++++++++------- addons/import_sugarcrm/sugar.py | 16 ++++ 2 files changed, 93 insertions(+), 31 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 59f7555b329..8b9f36ab20c 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -52,18 +52,34 @@ def get_all(sugar_obj, cr, uid, model, sugar_val, context=None): key=itemgetter(1)) return output -def get_all_states(sugar_obj, cr, uid, sugar_val, context=None): - return get_all(sugar_obj, +def get_all_states(sugar_obj, cr, uid, sugar_val, country_id, context=None): + state_id = False + res_country_state_obj = sugar_obj.pool.get('res.country.state') + + state = get_all(sugar_obj, cr, uid, 'res.country.state', sugar_val, context=context) - -def get_all_countries(sugar_obj, cr, uid, sugar_val, context=None): - return get_all(sugar_obj, - cr, uid, 'res.country', sugar_val, context=context) + if state: + state_id = state and state[0][0] + else: + state_id = res_country_state_obj.create(cr, uid, {'name': sugar_val, 'code': sugar_val, 'country_id': country_id}) + return state_id +def get_all_countries(sugar_obj, cr, uid, sugar_country_val, context=None): + + res_country_obj = sugar_obj.pool.get('res.country') + country_id = False + str = False + str = sugar_country_val[0:2] + country = get_all(sugar_obj, + cr, uid, 'res.country', sugar_country_val, context=context) + if country: + country_id = country and country[0][0] + else: + country_id = res_country_obj.create(cr, uid, {'name': sugar_country_val, 'code': str}) + return country_id def import_partner_address(sugar_obj, cr, uid, context=None): if not context: context = {} - res_country_obj = sugar_obj.pool.get('res.country') map_partner_address = { 'id': 'id', 'name': ['first_name', 'last_name'], @@ -81,21 +97,17 @@ def import_partner_address(sugar_obj, cr, uid, context=None): PortType, sessionid = sugar.login(context.get('username', ''), context.get('password', ''), context.get('url','')) sugar_data = sugar.search(PortType, sessionid, 'Contacts') for val in sugar_data: - str = val.get('primary_address_country')[0:2] - country = get_all_countries(sugar_obj, cr, uid, val.get('primary_address_country'), context) - if country: - country_id = country and country[0][0] - else: - country_id = res_country_obj.create(cr, uid, {'name': val.get('primary_address_country'), 'code': str}) - state = get_all_states(sugar_obj,cr, uid, val.get('primary_address_state'), context) + country_id = get_all_countries(sugar_obj, cr, uid, val.get('primary_address_country'), context) + state = get_all_states(sugar_obj,cr, uid, val.get('primary_address_state'), country_id, context) val['country_id/.id'] = country_id - val['state_id/.id'] = state and state[0][0] or False + val['state_id/.id'] = state fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) address_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) def import_users(sugar_obj, cr, uid, context=None): if not context: context = {} + department_id = False map_user = {'id' : 'id', 'name': ['first_name', 'last_name'], 'login': 'user_name', @@ -115,8 +127,12 @@ def import_users(sugar_obj, cr, uid, context=None): 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.id'] = new_department_id + department_ids = department_obj.search(cr, uid, [('name', '=', val.get('department'))]) + if department_ids: + department_id = department_ids[0] + elif val.get('department'): + department_id = department_obj.create(cr, uid, {'name': val.get('department')}) + val['context_department_id.id'] = 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 @@ -178,20 +194,21 @@ def get_opportunity_status(surgar_obj, cr, uid, sugar_val,context=None): def get_user_address(sugar_obj, cr, uid, val, context=None): address_obj = sugar_obj.pool.get('res.partner.address') - map_user_address = { 'name': ['first_name', 'last_name'], 'city': 'address_city', - 'country_id.id': 'address_country', - 'state_id.id': 'address_state', + 'country_id': 'country_id', + 'state_id': 'state_id', 'street': 'address_street', 'zip': 'address_postalcode', } address_ids = address_obj.search(cr, uid, [('name', '=',val.get('first_name') +''+ val.get('last_name'))]) - + country_id = get_all_countries(sugar_obj, cr, uid, val.get('address_country'), context) + state_id = get_all_states(sugar_obj, cr, uid, val.get('address_state'), country_id, context) + val['country_id'] = country_id + val['state_id'] = state_id fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_user_address) dict_val = dict(zip(fields,datas)) - if address_ids: address_obj.write(cr, uid, address_ids, dict_val) else: @@ -215,11 +232,10 @@ def get_address_type(sugar_obj, cr, uid, val, map_partner_address, type, context 'type': 'type', }) val['type'] = type - str = val.get(type_address +'_address_country')[0:2] - country = get_all_countries(sugar_obj, cr, uid, val.get(type_address +'_address_country'), context) - state = get_all_states(sugar_obj, cr, uid, val.get(type_address +'_address_state'), context) - val['country_id'] = country and country[0][0] or res_country_obj.create(cr, uid, {'name': val.get(type_address +'_address_country'), 'code': str}), - val['state_id'] = state and state[0][0] or False, + country_id = get_all_countries(sugar_obj, cr, uid, val.get(type_address +'_address_country'), context) + state = get_all_states(sugar_obj, cr, uid, val.get(type_address +'_address_state'), country_id, context) + val['country_id'] = country_id + val['state_id'] = state, fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) #Convert To list into Dictionary(Key, val). value pair. dict_val = dict(zip(fields,datas)) @@ -299,6 +315,7 @@ def import_resources(sugar_obj, cr, uid, context=None): def import_employees(sugar_obj, cr, uid, context=None): if not context: context = {} + job_id = False map_employee = {'id' : 'id', 'resource_id/.id': 'resource_id/.id', 'name': ['first_name', 'last_name'], @@ -322,8 +339,13 @@ def import_employees(sugar_obj, cr, uid, context=None): resource_id = sugar_obj.pool.get('ir.model.data').browse(cr, uid, model_ids) if resource_id: val['resource_id/.id'] = resource_id[0].res_id - new_job_id = job_obj.create(cr, uid, {'name': val.get('title')}) - val['job_id/.id'] = new_job_id + + job_ids = job_obj.search(cr, uid, [('name', '=', val.get('title'))]) + if job_ids: + job_id = job_ids[0] + else: + job_id = job_obj.create(cr, uid, {'name': val.get('title')}) + val['job_id/.id'] = job_id fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_employee) employee_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) @@ -378,16 +400,37 @@ def import_leads(sugar_obj, cr, uid, context=None): fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_lead) lead_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) + + +def get_opportunity_contact(sugar_obj,cr,uid, PortType, sessionid, val, partner_xml_id, context=None): + if not context: + context={} + partner_contact_name = False + model_obj = sugar_obj.pool.get('ir.model.data') + partner_address_obj = sugar_obj.pool.get('res.partner.address') + sugar_opportunity_contact = sugar.relation_search(PortType, sessionid, 'Opportunities', module_id=val.get('id'), related_module='Contacts', query=None, deleted=None) + for contact in sugar_opportunity_contact: + model_ids = find_mapped_id(sugar_obj, cr, uid, 'res.partner.address', contact, context) + if model_ids: + model_id = model_obj.browse(cr, uid, model_ids)[0].res_id + address_id = partner_address_obj.browse(cr, uid, model_id) + partner_address_obj.write(cr, uid, [address_id.id], {'partner_id': partner_xml_id[0]}) + partner_contact_name = address_id.name + else: + partner_contact_name = val.get('account_name') + return partner_contact_name + def import_opportunities(sugar_obj, cr, uid, context=None): if not context: context = {} categ_id = False + partner_contact_name = False map_opportunity = {'id' : 'id', 'name': 'name', 'probability': 'probability', 'partner_id/name': 'account_name', 'title_action': 'next_step', - 'partner_address_id/name': 'account_name', + 'partner_address_id/name': 'partner_address_id/name', 'planned_revenue': 'amount', 'date_deadline':'date_closed', 'user_id/id' : 'assigned_user_id', @@ -395,6 +438,7 @@ def import_opportunities(sugar_obj, cr, uid, context=None): 'type' : 'type', 'categ_id.id': 'categ_id.id' } + lead_obj = sugar_obj.pool.get('crm.lead') partner_obj = sugar_obj.pool.get('res.partner') categ_obj = sugar_obj.pool.get('crm.case.categ') @@ -402,13 +446,15 @@ def import_opportunities(sugar_obj, cr, uid, context=None): sugar_data = sugar.search(PortType, sessionid, 'Opportunities') for val in sugar_data: partner_xml_id = partner_obj.search(cr, uid, [('name', 'like', val.get('account_name'))]) + partner_contact_name = get_opportunity_contact(sugar_obj,cr,uid, PortType, sessionid, val, partner_xml_id, context) + val['partner_address_id/name'] = partner_contact_name if not partner_xml_id: raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) categ_ids = categ_obj.search(cr, uid, [('object_id.model','=','crm.lead'), ('name', 'like',val.get('opportunity_type'))]) if categ_ids: categ_id = categ_ids[0] else: - categ_id = categ_obj.create(cr, uid, {'name': val.get('opportunity_type'), 'object_id.model': 'crm.lead'}) + categ_id = categ_obj.create(cr, uid, {'name': val.get('opportunity_type'), 'object_id.model': 'crm.lead'}) val['categ_id.id'] = categ_id val['type'] = 'opportunity' stage_id = get_opportunity_status(sugar_obj, cr, uid, val, context) diff --git a/addons/import_sugarcrm/sugar.py b/addons/import_sugarcrm/sugar.py index 7bba370f812..e74d5cc9307 100644 --- a/addons/import_sugarcrm/sugar.py +++ b/addons/import_sugarcrm/sugar.py @@ -48,6 +48,22 @@ def login(username, password, url): raise LoginError(response._return._error._description) return (portType, response._return._id) +def relation_search(portType, sessionid, module_name=None, module_id=None, related_module=None, query=None, deleted=None): + se_req = get_relationshipsRequest() + se_req._session = sessionid + se_req._module_name = module_name + se_req._module_id = module_id + se_req._related_module = related_module + se_resp = portType.get_relationships(se_req) + ans_list = [] + if se_resp: + list = se_resp._return.get_element_ids() + for i in list: + ans_dir = {} + ans_list.append(i.get_element_id()) + return ans_list + + def search(portType, sessionid, module_name=None): se_req = get_entry_listRequest() se_req._session = sessionid From ab8a8818037431b96e4b0d8a0664063578cadfe7 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Fri, 1 Apr 2011 10:48:58 +0530 Subject: [PATCH 08/10] [FIX]: Fixed duplication key error for employees bzr revid: atp@tinyerp.com-20110401051858-ax97kx0gxqp76vth --- addons/import_sugarcrm/import_sugarcrm.py | 38 ++++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 8b9f36ab20c..7d8efd757e4 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -53,6 +53,7 @@ def get_all(sugar_obj, cr, uid, model, sugar_val, context=None): return output def get_all_states(sugar_obj, cr, uid, sugar_val, country_id, context=None): + """Get states or create new state""" state_id = False res_country_state_obj = sugar_obj.pool.get('res.country.state') @@ -64,7 +65,7 @@ def get_all_states(sugar_obj, cr, uid, sugar_val, country_id, context=None): state_id = res_country_state_obj.create(cr, uid, {'name': sugar_val, 'code': sugar_val, 'country_id': country_id}) return state_id def get_all_countries(sugar_obj, cr, uid, sugar_country_val, context=None): - + """Get Country or Create new country""" res_country_obj = sugar_obj.pool.get('res.country') country_id = False str = False @@ -104,6 +105,18 @@ def import_partner_address(sugar_obj, cr, uid, context=None): fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) address_obj.import_data(cr, uid, fields, [datas], mode='update', current_module='sugarcrm_import', context=context) +def get_users_department(sugar_obj, cr, uid, val, context=None): + if not context: + context={} + department_id = False + department_obj = sugar_obj.pool.get('hr.department') + department_ids = department_obj.search(cr, uid, [('name', '=', val)]) + if department_ids: + department_id = department_ids[0] + elif val: + department_id = department_obj.create(cr, uid, {'name': val}) + return department_id + def import_users(sugar_obj, cr, uid, context=None): if not context: context = {} @@ -118,7 +131,6 @@ def import_users(sugar_obj, cr, uid, context=None): 'context_department_id.id': 'context_department_id.id', } user_obj = sugar_obj.pool.get('res.users') - department_obj = sugar_obj.pool.get('hr.department') PortType,sessionid = sugar.login(context.get('username',''), context.get('password',''), context.get('url','')) sugar_data = sugar.search(PortType,sessionid, 'Users') for val in sugar_data: @@ -127,11 +139,7 @@ def import_users(sugar_obj, cr, uid, context=None): val['.id'] = str(user_ids[0]) else: val['password'] = 'sugarcrm' #default password for all user - department_ids = department_obj.search(cr, uid, [('name', '=', val.get('department'))]) - if department_ids: - department_id = department_ids[0] - elif val.get('department'): - department_id = department_obj.create(cr, uid, {'name': val.get('department')}) + department_id = get_users_department(sugar_obj, cr, uid, val.get('department'), context=context) val['context_department_id.id'] = department_id val['context_lang'] = context.get('lang','en_US') fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_user) @@ -160,7 +168,7 @@ def get_lead_status(surgar_obj, cr, uid, sugar_val,context=None): def get_lead_state(surgar_obj, cr, uid, sugar_val,context=None): if not context: context = {} - state = '' + state = False state_dict = {'status': #field in the sugarcrm database { #Mapping of sugarcrm stage : openerp opportunity stage 'New' : 'draft', @@ -175,7 +183,7 @@ def get_lead_state(surgar_obj, cr, uid, sugar_val,context=None): def get_opportunity_status(surgar_obj, cr, uid, sugar_val,context=None): if not context: context = {} - stage_id = '' + stage_id = False stage_dict = { 'sales_stage': {#Mapping of sugarcrm stage : openerp opportunity stage Mapping 'Need Analysis': 'New', @@ -235,7 +243,7 @@ def get_address_type(sugar_obj, cr, uid, val, map_partner_address, type, context country_id = get_all_countries(sugar_obj, cr, uid, val.get(type_address +'_address_country'), context) state = get_all_states(sugar_obj, cr, uid, val.get(type_address +'_address_state'), country_id, context) val['country_id'] = country_id - val['state_id'] = state, + val['state_id'] = state fields, datas = sugarcrm_fields_mapping.sugarcrm_fields_mapp(val, map_partner_address) #Convert To list into Dictionary(Key, val). value pair. dict_val = dict(zip(fields,datas)) @@ -301,7 +309,7 @@ def import_partners(sugar_obj, cr, uid, context=None): def import_resources(sugar_obj, cr, uid, context=None): if not context: context = {} - map_resource = {'id' : 'id', + map_resource = {'id' : 'user_hash', 'name': ['first_name', 'last_name'], } resource_obj = sugar_obj.pool.get('resource.resource') @@ -316,7 +324,7 @@ def import_employees(sugar_obj, cr, uid, context=None): if not context: context = {} job_id = False - map_employee = {'id' : 'id', + map_employee = {'id' : 'user_hash', 'resource_id/.id': 'resource_id/.id', 'name': ['first_name', 'last_name'], 'work_phone': 'phone_work', @@ -335,7 +343,7 @@ def import_employees(sugar_obj, cr, uid, context=None): for val in sugar_data: address_id = get_user_address(sugar_obj, cr, uid, val, context) val['address_home_id/.id'] = address_id - model_ids = find_mapped_id(sugar_obj, cr, uid, 'resource.resource', val.get('id')+ '_resource_resource', context) + model_ids = find_mapped_id(sugar_obj, cr, uid, 'resource.resource', val.get('user_hash')+ '_resource_resource', context) resource_id = sugar_obj.pool.get('ir.model.data').browse(cr, uid, model_ids) if resource_id: val['resource_id/.id'] = resource_id[0].res_id @@ -446,10 +454,10 @@ def import_opportunities(sugar_obj, cr, uid, context=None): sugar_data = sugar.search(PortType, sessionid, 'Opportunities') for val in sugar_data: partner_xml_id = partner_obj.search(cr, uid, [('name', 'like', val.get('account_name'))]) - partner_contact_name = get_opportunity_contact(sugar_obj,cr,uid, PortType, sessionid, val, partner_xml_id, context) - val['partner_address_id/name'] = partner_contact_name if not partner_xml_id: raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) + partner_contact_name = get_opportunity_contact(sugar_obj,cr,uid, PortType, sessionid, val, partner_xml_id, context) + val['partner_address_id/name'] = partner_contact_name categ_ids = categ_obj.search(cr, uid, [('object_id.model','=','crm.lead'), ('name', 'like',val.get('opportunity_type'))]) if categ_ids: categ_id = categ_ids[0] From 8a7e08b3a21e628a12d1d463d77b7397d2e5c7e2 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Fri, 1 Apr 2011 11:04:11 +0530 Subject: [PATCH 09/10] [IMP]: Improve exception message. bzr revid: atp@tinyerp.com-20110401053411-oy2yjoxbpgg7zfji --- addons/import_sugarcrm/import_sugarcrm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 7d8efd757e4..ef964d66cd5 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -455,7 +455,7 @@ def import_opportunities(sugar_obj, cr, uid, context=None): for val in sugar_data: partner_xml_id = partner_obj.search(cr, uid, [('name', 'like', val.get('account_name'))]) if not partner_xml_id: - raise osv.except_osv(_('Warning !'), _('Partner %s not Found') % val.get('account_name')) + raise osv.except_osv(_('Warning !'), _('Reference Partner %s cannot be created, due to Lower Record Limit in SugarCRM Configuration.') % val.get('account_name')) partner_contact_name = get_opportunity_contact(sugar_obj,cr,uid, PortType, sessionid, val, partner_xml_id, context) val['partner_address_id/name'] = partner_contact_name categ_ids = categ_obj.search(cr, uid, [('object_id.model','=','crm.lead'), ('name', 'like',val.get('opportunity_type'))]) From ad56cb66f0691e0eaf7698d26ae6deb2324958a0 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Fri, 1 Apr 2011 11:15:46 +0530 Subject: [PATCH 10/10] [IMP]: Improve Menu and String Name. bzr revid: atp@tinyerp.com-20110401054546-atqvo46ns99mdbwl --- addons/import_sugarcrm/__openerp__.py | 3 ++- addons/import_sugarcrm/import_sugarcrm_view.xml | 4 ++-- addons/import_sugarcrm/wizard/sugarcrm_login_view.xml | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/import_sugarcrm/__openerp__.py b/addons/import_sugarcrm/__openerp__.py index 1848b53df37..ee9c436b598 100644 --- a/addons/import_sugarcrm/__openerp__.py +++ b/addons/import_sugarcrm/__openerp__.py @@ -23,7 +23,8 @@ 'name': 'Import SugarCRM Data into OpenERP Module.', 'version': '1.0', 'category': 'Generic Modules', - 'description': """This Module Import SugarCRM "Leads", "Opportunities", and "Users" Data into OpenERP Module.""", + 'description': """This Module Import SugarCRM "Leads", "Opportunities", "Users", "Accounts", + "Contacts" and "Employees" Data into OpenERP Module.""", 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['crm', 'hr'], diff --git a/addons/import_sugarcrm/import_sugarcrm_view.xml b/addons/import_sugarcrm/import_sugarcrm_view.xml index 1ad78f7a410..8410dacdbb1 100644 --- a/addons/import_sugarcrm/import_sugarcrm_view.xml +++ b/addons/import_sugarcrm/import_sugarcrm_view.xml @@ -8,7 +8,7 @@ import.sugarcrm form -
+ @@ -34,7 +34,7 @@ - Import Sugarcrm + Import SugarCRM import.sugarcrm form tree,form diff --git a/addons/import_sugarcrm/wizard/sugarcrm_login_view.xml b/addons/import_sugarcrm/wizard/sugarcrm_login_view.xml index 4cb8fe98ab6..cb09a3efc10 100644 --- a/addons/import_sugarcrm/wizard/sugarcrm_login_view.xml +++ b/addons/import_sugarcrm/wizard/sugarcrm_login_view.xml @@ -8,7 +8,7 @@ sugarcrm.login form - + @@ -31,7 +31,7 @@ - Sugarcrm Login + SugarCRM Login sugarcrm.login form tree,form @@ -39,8 +39,8 @@ new - - + +