Odoo Help

Welcome!

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.

1

Change the Position of field in Xpath

By
Rajiv
on 2/20/15, 5:49 AM 4,221 views

Hi

I want to change the position of Field in the Form View (Parent) to the new Position (In my In herited view). Is there any way.

Example:

Parent View:

<record id="1" model="1">

<field name="arch" type="xml">

<group>

<field name="X"/>

</group>

.....

.....

<group>

<field name="Y"/>

</group>

</field>

</record>

So I want to move the field Y to inside the group X. Not only field. Also I need to move the any other tags like <div> or <group> itself as bunch.

Is there any Xpath which is like below.

<xpath expr="//form/sheet/group/group/field[@name='email']" position="move">

Please help...

 

 

3
Mansi Kariya (mka)
On 2/20/15, 6:00 AM

Hello,

There is no such value allowed like move in xpath. Values allowed are

  • inside (default): your values will be appended inside the tag

  • after: add the content after the tag

  • before: add the content before the tag

  • replace: replace the content of the tag.

You have to simply replace that field. and put it to new position. For more details, You can refer Doc or can ask me too.

<xpath expr="//group/field[@name='X']" position="replace"/>

This will remove field from that position. Now you can put it to other place you want. Suppose you want to place it after field "Y". Example -

<xpath expr="//group/field[@name='Y']" position="after">
<field name="X"/>
</xpath>

This way, You can change postion of any field, group etc.

Hope this will help you.

Hello @Mansi, I want to add new boolean filed after supplier boolean field in res.partner form inside sale & purchase tab. Can you help me.! Thanks in advance.

Mohit Kotak (MK)
on 2/21/15, 12:07 AM

Inherit view_partner_form and then givve xpath like //page[@string='Sales & Purchases']/group/group/field[@name='supplier'] and give position to after

Mansi Kariya (mka)
on 2/23/15, 12:25 AM
0

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 2/20/15, 6:10 AM

Hi Rajiv,,

Here you can use position=replace

you can select the code or block you want to replace

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

1 follower(s)

Stats

Asked: 2/20/15, 5:49 AM
Seen: 4221 times
Last updated: 8/30/16, 10:10 AM