Mark
Mark

Reputation: 704

Open ERP 6.1 add field inherited view

I have a parent view id V which is a form F and inside this form a Goup with 3 fields F1, F2 and F3.

My inherited view looks like:

<record model="ir.ui.view" id="view_v_form">
    <field name="name">My view</field>
    <field name="model">my.module.class</field>
    <field name="inherit_id" ref="parent_module.V"/>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <xpath expr="//form/field[@name='F3']" position="before">
            <field name="myField"/>
        </xpath> 
    </field>
</record>

But it doesn't appear anywhere, any idea?

Upvotes: 1

Views: 68

Answers (1)

ChesuCR
ChesuCR

Reputation: 9620

Make sure you have added parent_module to the depends attribute in the __openerp__.py file, and the xml file path to the update_xml attribute as well.

You don´t need to specify the form type and you don´t need to use the xpath neither:

<record model="ir.ui.view" id="view_v_form">
    <field name="name">My view</field>
    <field name="model">my.module.class</field>
    <field name="inherit_id" ref="parent_module.V"/>
    <field name="arch" type="xml">
        <field name="F3" position="before">
            <field name="myField"/>
        </field>
    </field>
</field>

Upvotes: 1

Related Questions