Odoo Help


How to place a group in inherited form view, when groups are not named?

on 10/28/13, 4:56 AM 9,210 views


Is there a way to place a group in inherited view after a specific group, when the groups are not named?

When groups have names, it is simple, f.e.:

<xpath expr="/form/sheet/group[@name='Foo']" position="after">

But can it be done for base.view_partner_form (I have marked where I'd like to place a group at the bottom of following code) :

<record id="view_partner_form" model="ir.ui.view">
    <field name="name">res.partner.form</field>
    <field name="model">res.partner</field>
    <field eval="1" name="priority"/>
    <field name="arch" type="xml">
        <form string="Partners" version="7.0">
            <field name="image" widget='image' class="oe_left oe_avatar" options='{"preview_image": "image_medium", "size": [90, 90]}'/>
            <div class="oe_title">
                <div class="oe_edit_only">
                    <label for="name"/> (
                    <field name="is_company" on_change="onchange_type(is_company)" class="oe_inline"/> <label for="is_company" string="Is a Company?"/>)
                    <field name="name" default_focus="1" placeholder="Name" />
                <field name="parent_id"
                    domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier}"
                    attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"
                    on_change="onchange_address(use_parent_address, parent_id)"/>
                <field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
            <div class="oe_right oe_button_box" name="buttons"> </div>

                    <label for="type" attrs="{'invisible': [('parent_id','=', False)]}"/>
                    <div attrs="{'invisible': [('parent_id','=', False)]}" name="div_type">
                        <field class="oe_inline"

                    <label for="street" string="Address"/>
                        <field name="use_parent_address" class="oe_edit_only oe_inline"
                               on_change="onchange_address(use_parent_address, parent_id)"
                               attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
                        <label for="use_parent_address" class="oe_edit_only" attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
                        <button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
                                attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
                        <field name="street" placeholder="Street..."  attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                        <field name="street2"  attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                        <div class="address_format">
                            <field name="city" placeholder="City" style="width: 40%%" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                            <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                            <field name="zip" placeholder="ZIP" style="width: 20%%" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                        <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}' attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                    <field name="website" widget="url" placeholder="e.g. www.openerp.com"/>
                    <field name="function" placeholder="e.g. Sales Director"
                        attrs="{'invisible': [('is_company','=', True)]}"/>
                    <field name="phone" placeholder="e.g. +"/>
                    <field name="mobile"/>
                    <field name="fax"/>
                    <field name="email" widget="email"/>
                    <field name="title" domain="[('domain', '=', 'contact')]"
                        options='{"no_open": True}' attrs="{'invisible': [('is_company','=', True)]}" />
               <!-- I would like to place a group here -->

Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 10/28/13, 3:51 PM

Try this:

<xpath expr="/form/sheet/group" position="inside"></xpath>

Or you can do this too:

<xpath expr="/form/sheet/group[1]" position="inside"></xpath>
Ashif Abdulrahman
On 10/29/13, 8:44 AM

You can use

<xpath expr="//form/sheet/group[1]/group[2]" position="after">



| 5 4 8
Casablanca, Morocco
On 10/28/13, 2:28 PM

Hi Antanas,
I think there is no way to use an unnamed tag in the xpath expression.
Try to replace all content of sheet tag : <xpath expr="/form/sheet" position="replace">

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/28/13, 4:56 AM
Seen: 9210 times
Last updated: 3/16/15, 8:10 AM