Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
7683 มุมมอง

Hi expert,

I am using odoo 9. My requirement is , replace sale.order view tab 'Orders Line' with different template

I am trying with the following code. But i am getting below error. Please help me to resolve this problem


<xpath expr="//form//sheet//notebook//page[1]" position="replace">

     <page string="Order Lines">

          <div>Content will be replaced soon</div>

     </page>

    </xpath>

I hope this should replace tab with div element. but its not working.


Error details:

Element '<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']">' cannot be located in parent view

Error context:

View `sale.order.form.inherit_1`

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The point is that you are trying to remove a field, which used in other apps' xmls.

For example, in 'purchase' you may find: <xpath expr="//field[@name='product_id']" position="before">. There are lot of (!!!) basic and community-built apps which rely upon that xml

What you should do:

* Find all sale order form view inherited forms (you may do it via developer mode through the interface)

* Define which apps do that in your database

* Make your app depend (in the manifest file - __openerp__.py) on all other apps which modify sales orders views.


Be cautious, however, there is a lot of logics applied to lines. You may loose it.


Besides, I do not understand, why you used doubled '/' in your expath, when you define the exact route. A single '/' must be enough (except the first one)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Actually i got the same error you mentioned above. But i met this error while creating field. If a group is inside the another group or a page is inside the another page we have to mention that group/page like this. Just try this.

<xpath expr="//form/sheet/notebook/page/page" position="replace">

     <page string="Order Lines">

          <div>Content will be replaced soon</div>

     </page>

    </xpath>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 17
4711
6
มิ.ย. 16
6374
0
ก.พ. 16
3338
0
พ.ย. 15
3537
1
ก.ย. 15
4232