跳至内容
菜单
此问题已终结
1 回复
5611 查看

I'm getting Odoo Server Error while opening a form.

I made a new class called product_mine which is _inherits-ed from "product.product".

And the form view is inherit from "product.product_normal_form_view".

FYI,

class product_mine(osv.osv):
    _name = "product_mine"
    _description = "My Product"
    _inherits = {'product.product': 'product_id'}
    
    _columns = {
        'country_id': fields.many2one('res.country','Country of Origin', readonly=False, required=False),
        'product_id': fields.many2one('product.product', 'Product', ondelete='cascade', required=True, auto_join=True)
     }

        <record id="my_product_normal_form_view" model="ir.ui.view">
            <field name="name">My Product Form</field>
            <field name="model">product_mine</field>
            <field name="mode">primary</field>
            <field eval="7" name="priority"/>
            <field name="inherit_id" ref="product.product_normal_form_view"/>
            <field name="arch" type="xml">
                <field name="default_code" position="after">
                    <field name="country_id"/>
                </field>
            </field>

形象
丢弃
最佳答案

Your class must inherit mail.thread. Add _inherit = ['mail.thread']  and it will work.

形象
丢弃
相关帖文 回复 查看 活动
1
12月 24
3815
0
11月 24
1572
2
7月 24
3201
0
4月 24
2102
3
3月 24
1937