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.

0

xpath after field div tag

By
Prakash
on 11/18/13, 10:37 AM 2,177 views
  <form string="Contact" version="7.0">
        <header>
            <field name="state" widget="statusbar" statusbar_visible="draft,assigned,cancel"/>
        </header>
        <notebook>
          <page string="Contact Details"> 
              <group>
               <group col="4" colspan="2">
                 <label for="name" class="custom_allign"/>
                    <div>
                    <field name="name"/>
                    </div>  
                   <label for="phone_no" class="custom_allign"/>
                    <div>
                     <field name="phone_no" class="oe_inline"/> 
                    </div>
                </group>
                <group col="6" colspan="2">
                  <label for="dob" class="custom_allign"/>
                  <div>
                    <field name="dob"/>
                  </div>
                  <label for="date" class="custom_allign"/>
                  <div>
                      <field name="date"/>
                  </div>  
                 </group>
               <group col="4" colspan="2">
                    <label for="address1" class="custom_allign"/>
                    <div>
                   <field name="address1"/>
                    </div>
                    <label for="address3" class="custom_allign"/>
                    <div>
                    <field name="address3"/>
                    </div>
              </group>
              </group>
             </page>

Based on above code using xpath how to set address1 field after address2 ?

    <<field name="address1" position="after">
        <label for="address2"/>
            <field  name="address2"/>       
        </field>

The above code added before div tag using xml how to set above code

2

Grover Menacho

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

Systems Engineer + MBA

Grover Menacho
On 11/18/13, 11:06 AM

Sometimes there are no possibilities for xpath, well I don't know any... you have to do this:

<xpath expr="//label[@for='address3']" position="before">
    <label for="address2"/>
        <field  name="address2"/>       
    </xpath>

Thanks Grover Menacho its working

Prakash
on 11/19/13, 5:49 AM

Great, please mark the answer as correct if it worked for you. Thanks

GH Mediacloud, Grover Menacho
on 11/19/13, 9:09 AM

Many thanks Grover !!!

+1

Ankit H Gandhi(AHG)
on 6/19/16, 8:43 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)

Stats

Asked: 11/18/13, 10:37 AM
Seen: 2177 times
Last updated: 3/16/15, 8:10 AM