Odoo Help


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.


ValueError: too many values to unpack

on 3/30/16, 11:05 PM 805 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 4 8
Surat, India
--Jignesh Mehta--

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.


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

1 follower(s)


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