Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
29038 มุมมอง

how to Inherit the product form view

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The following can be used to inherit the product form view.

<record id="product_normal_form_view1" model="ir.ui.view">
        <field name="name">product.product.form1</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view" />
        <field name="type">form</field>
        <field name="arch" type="xml">
               <!-- CUSTOMIZATIONS -->
        </field>
    </record>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You need to get OpenERP guide for Developers

this in you python code i think should work fine

 class product_product(osv.osv):
_name = 'product.product'
_inherit = 'product.product'
_columns = {
    'your_field': fields.char('Your Field Name',size=50,select=True),
    'your_field_2': fields.date('Your Field 2 Name', size=50, required=False),          
product_product()

this code in your xml should do it

<record model="ir.ui.view" id="view_product_product_form">
    <field name="name">product.product.form</field>
    <field name="model">product.product</field>
    <field name="inherit_id" ref="product.product_normal_form_view"/>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <field name="name" position="after">
                   <field name="your_field" select="0"/>           
        </field>
        <field name="default_code" position="replace">
            <field name="your_field_2" />
        </field>        
    </field>
</record>
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
How to inherit data file in Odoo? แก้ไขแล้ว
2
พ.ค. 23
4764
2
มี.ค. 15
8193
1
ส.ค. 25
172
2
มิ.ย. 25
1691
0
มี.ค. 25
1563