odoo view inheritance

ODOO view Inheritance:

     Note: odoo view inherit the parent view will change the interface display (though the father did not view any change in the operation, but in view of the parent interface will be displayed after the sub-interface view is inherited)

<odoo>
    <data>
        <record id="utodo_task_view_form" model="ir.ui.view">
            <field name="name">utodo.task.view_form</field>
            <field name="model">todo.task</field>
            <field name="inherit_id" ref="todo.todo_task_view_form"/>
            <field name="arch" type="xml">
                <field name="is_done" position="after">
                    <field name="budget"/>
                </field>
            </field>
        </record>

        <record id="utodo_task_view_tree" model="ir.ui.view">
            <field name="name">utodo.task.view_tree</field>
            <field name="model">todo.task</field>
            <field name="inherit_id" ref="todo.todo_task_view_tree"/>
            <field name="arch" type="xml">
               <field name="is_done" position="after">
                    <field name="budget"/>
                </field>
            </field>
        </record>
    </data>
</odoo>
# Match only when a field, erpr expression can be simplified as follows 
<XPath expr = " // Field [@ name = 'Upload'] " position = " Replace " > // the attribute value expr mean: Found <filed name = "upload" /> tag <Field name = " downloads " /> </ XPath> <Field name = " Upload " position = " Replace " > <Field name = " downloads " /> </ Field>

selection position positioned below

  • At the end of the insertion element inside the interior

  • replace replaced elements

  • before insertion element prior to

  • thereafter inserted after the element

  • modify the properties of xml attributes

Guess you like

Origin www.cnblogs.com/smarttony/p/11648514.html