Skip to Content
Menu
This question has been flagged
1 Odpoveď
5500 Zobrazenia

I am trying to import a set of lead data via the CSV import. I created a dummy lead and exported it to confirm the format and mandatory columns. As far as I can see I have everything matching (clearly something is wrong though). I have also tried various tweaks to the CSV file including controlling the encoding format and quoting all fields. The result is the same every time - "need more than 1 value to unpack".
The format and sample data are:


"contact_name","title","Function","email_from","partner_name","Street","city","Zip","phone","FAX","ref2","ref","Subject" "Michael Smith","Mr","Accounts Manager","m.smith@tbps.co.uk","The Big Partnership","Ground Floor, Big Towers Court Main Street","Anytown","AT41 1AT","01234563000","01234564000","www.thebigpartnership.co.uk",70,"Professional Services"


The error block from the logs is given below:


Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, args, *kwargs) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/usr/lib/pymodules/python2.7/openerp/addons/base_import/models.py", line 320, in do cr, uid, import_fields, data, context=context) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1379, in load noupdate=noupdate, res_id=id, context=context)) File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_model.py", line 967, in _update res_id = model_obj.create(cr, uid, values, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/crm/crm_lead.py", line 99, in create return super(crm_lead, self).create(cr, uid, vals, context=create_context) File "/usr/lib/pymodules/python2.7/openerp/addons/mail/mail_thread.py", line 241, in create thread_id = super(mail_thread, self).create(cr, uid, values, context=context) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4452, in create self._check_selection_field_value(cr, user, field, vals[field], context=context) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2817, in _check_selection_field_value val_model, val_id_str = value.split(',', 1) ValueError: need more than 1 value to unpack


I may be staring at something obvious, but I can't see why I'm getting this error. Can anybody provide any clues, please?

Avatar
Zrušiť
Best Answer

Try importing all the fields but the field street. The comma in the field street is causing the problem. Try switching to a different column separator, such as the # character. That will make your import process easier

Avatar
Zrušiť
Autor

Gustavo - Thank you for taking the time to reply. I used the hash as the separator and switched off the street import. That didn't solve it, but the hash with the two reference columns switched off did solve the problem. If our paths ever cross, I owe you a beer.

Related Posts Replies Zobrazenia Aktivita
1
nov 19
7220
0
nov 17
2682
1
mar 15
3423
1
mar 15
5253
2
júl 25
2181