Odoo Help


ValueError: too many values to unpack

on 3/30/16, 11:05 PM 2,444 views

I created a new object for alternate model in product, but everytime I access products - it returns an error: (I'm using new api)


ValueError: too many values to unpack

Python file

from openerp import fields, models

class ProductAlternateModel(models.Model):
    _name = 'product.alternate.model'


class product_product(models.Model):
    _inherit = 'product.product'

    alternate_model_ids = fields.Many2many('product.alternate.model')

XML File (Product Form)

<xpath expr="//field[@name='lst_price']" position="after">
                    <page string="Alternate Model">
                        <field name="alternate_model_ids"/>

Jignesh Mehta

--Jignesh Mehta--
| 6 5 8
Surat, India
--Jignesh Mehta--

- I have 3+ years of Industry Experience, specializing Odoo Development, Analysis, Customization, Implementation, Integration.
- I have done many Customization modules in Sale, Purchase, Point of Sale, Inventory, CRM and much more. Also Worked in the Odoo Themes like Business Theme or E-Commerce Theme.
- Develop Jewelery Manufacturing process from Scratch. It have more than 10 Department. Develop PDF and Excel reports for this project around 150 per format.

Jignesh Mehta
On 3/31/16, 2:05 AM

Hello Anonymous,

Your Many2many field is define wrong.

Try this :-

alternate_model_ids = fields.Many2many('product.alternate.model', 'product_model', 'alternate_id', 'alternate_model_id', 'Alternate Model')

Hope this will 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

1 follower(s)


Asked: 3/30/16, 11:05 PM
Seen: 2444 times
Last updated: 3/31/16, 2:05 AM