Odoo Help

Welcome!

This community 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.

0

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

By
Ged Mirski-Fitton
on 1/18/14, 4:30 AM 3,380 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
2

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

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.

 

 

0
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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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