Odoo Help


Error when importing Leads - need more than 1 value to unpack

Ged Mirski-Fitton
on 1/18/14, 4:30 AM 4,983 views

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?

@Ray Carnes. Thank for a very clear answer.  That helped tremendously.

What Giants, Ged Mirski-Fitton
on 6/10/14, 2:18 AM

Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 5/29/14, 4:34 PM

"_check_selection_field_value" indicates that a selection field was unable to be parsed.

The only selection field (appears with a dropdown of values to select on the UI) you are using is Title.

Mr is not a valid value for this field.  It is expecting an External ID which contains a and that's why the parser can't split that field.  

Valid values for that field include:

  • base.res_partner_title_doctor
  • base.res_partner_title_madam
  • base.res_partner_title_miss
  • base.res_partner_title_mister
  • base.res_partner_title_prof
  • base.res_partner_title_sir

Note the period between the word base and the rest of the ID.



Boniface Irungu
On 5/29/14, 1:29 PM

Hi, The reason you are gettting this error is because some values are missing on the csv file you are trying to upload. Example look at the ir.property model or you can access this directly from the settings>parameters>configuration parameters. Click and open one of the records. You will see that there are input fields that go in-hand i.e should be updated together. Look at the fields under label Resources. You can activate the developer mode to have a clear view on these fields. So to fix your error, make sure that you have captured all fields on your csv before trying to upload.  ( need more than 1 value to unpack) > means that an item is missing and it's needed for successful upload of your data. Hope this helps you.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 1/18/14, 4:30 AM
Seen: 4983 times
Last updated: 3/16/15, 8:10 AM