This question has been flagged
1 Reply
5057 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

<group>

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"/>
</group>

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.

Avatar
Discard
Best Answer
Lets suppose you have the structure like this 

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

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>
     <group>
             <field name="XYZ" />
    </group>
</xpath>
Avatar
Discard
Author

Thanks alot! It works very well.

My Pleasure sir ! :-)