Skip to Content
Menu
This question has been flagged
5 Replies
23902 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

Avatar
Discard
Best Answer

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>
Avatar
Discard
Author

Thanks Grover Menacho its working

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

Many thanks Grover !!!

+1

+1

Thanks alot

Best Answer

Hi Prakash,

Please use below code.

use indexes, like

<xpath expr="//div[1]/div[3]" position="name of position">

     write your code here..

</xpath>

Exaplanation above code:

indexes 1 and 3 are indicating position numbers. "//div[1]" should be first div in a inherited view.

accordingly "//div[1]/div[3]" - third child div of the first div in the inherited view.

Hope this help you.

Best Thanks,

Ankit H Gandhi.

Avatar
Discard