OCA/server-tools

View on GitHub
base_view_inheritance_extension/demo/ir_ui_view.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <record id="view_partner_form" model="ir.ui.view">
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form" />
            <field name="arch" type="xml">
                <xpath expr="." position="attributes">
                    <attribute name="string">Partner form</attribute>
                </xpath>
                <field name="parent_id" position="attributes">
                    <attribute name="context" operation="python_dict" key="default_name">'The company name'</attribute>
                    <attribute name="context" operation="python_dict" key="default_company_id">context.get('company_id', context.get('company'))</attribute>
                </field>
                <notebook position="inside">
                    <page string="A new page" name="my_new_page" />
                </notebook>
                <xpath expr="//field[@name='child_ids']" position="move" target="//page[@name='my_new_page']" />
            </field>
        </record>
        <record id="view_partner_form_demo" model="ir.ui.view">
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form" />
            <field name="user_ids" eval="[(4, ref('base.user_demo'))]" />
            <field name="arch" type="xml">
                <sheet position="inside">
                    <div>I am a private form for the demo user</div>
                </sheet>
            </field>
        </record>
     </data>
</openerp>