Odoo Help


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


How to put elements (tags like fields) in view after another element without any name or string?

Tomas Parnarauskas
on 7/19/13, 4:07 AM 878 views

Hello, I tried to ask this similar question in my previous post, but nothing seemed to understand what was I asking, so gave me answer not really related to what I was asking (or links given where to look didn't give me that answer). So I'll try to make this question more clear here. What I need is add my fields after element


It does not have any attributes like name, string etc. So I can't just give path like:

<group some_attribute="some_attribute_name" position=after>
<field name="my_field"/>

So is it possible to somehow position after that 'group' element when it does not have any attributes for system to know which 'group' element I mean? In leads/opportunities views there are many group elements without any attributes. So it's hard to position using it.

Also (if it is not possible to position after group without any attributes), maybe it is possible at least to just specify somehow that my fields will go just bellow every other fields in a view that I inherited?

Because now the only way I found to do something similar was to position my fields just after the last field in the inherited view. But then my all fields go to that last fields group, which I do not need.

Nishant Kashyap
On 7/19/13, 5:24 AM
Lets suppose you have the structure like this 

<form string='Job' version=7.0>
             <button name= ......../>
            <button name=......../>
                             <field name="field1"/>
                             <field name="field2"/>
                            <field name="field3"/>
                            <field name="field4"/>

Now you want to add a field or any group before the group 2 then you can use the xpath to choose the group second from the inherited view like this.

<xpath expr="/form/sheet/group/group[2]" position=before>
             <field name="XYZ" />

Thanks alot! It works very well.

NOD Baltic, UAB, Tomas Parnarauskas
on 7/19/13, 5:53 AM

My Pleasure sir ! :-)

Nishant Kashyap
on 7/19/13, 5:55 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 7/19/13, 4:07 AM
Seen: 878 times
Last updated: 3/16/15, 8:10 AM