Search code examples
odooodoo-10odoo-9

How add new group after existing group


How with xpath add new group after existing group in hr_employee.

After Birth I need add my new group

<group string="Birth">
    <field name="birthday"/>
</group>

I'm try with below example but not working

<xpath expr="//group[@string='Birth']" position="after">
    <group string="New group">
        <group>
            <field name="new1" />
        </group>
    </group>
</xpath>

Solution

  • Xpath doesnt work well with string attribue. Better way is to find birthday field and then go top.

    <xpath expr="//field[@name='birthday']/.." position="after">
        <group string="New group">
            <group>
                <field name="new1" />
            </group>
        </group>
    </xpath>