コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
12625 ビュー

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

Error

ValueError: too many values to unpack

Python file

from openerp import fields, models

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

    #fields

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">
                <notebook>
                    <page string="Alternate Model">
                        <field name="alternate_model_ids"/>
                    </page>
                </notebook>
            </xpath>
アバター
破棄
最善の回答

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.

Thanks,

アバター
破棄
関連投稿 返信 ビュー 活動
2
5月 25
1359
0
12月 24
1533
1
3月 24
2606
2
1月 24
2895
0
11月 23
1647