Odoo Help


ValueError: too many values to unpack

on 3/30/16, 11:05 PM 2,225 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
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: 2225 times
Last updated: 3/31/16, 2:05 AM