Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
24807 Lượt xem
  <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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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>
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ