Odoo Help

Welcome!

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.

0

how to Inherit the product form view

By
veena vasudevan
on 1/7/14, 6:16 AM 5,606 views

how to Inherit the product form view

1

Gopakumar N G

--Gopakumar N G--
1198
| 5 3 7
Cochin, India
--Gopakumar N G--

Senior Software Engineer at BroadTech IT Solutions Pvt. Ltd.

Gopakumar N G
On 1/7/14, 6:47 AM

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>
0
kaynis
On 1/7/14, 6:55 AM

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>

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)

Stats

Asked: 1/7/14, 6:16 AM
Seen: 5606 times
Last updated: 3/16/15, 8:10 AM