Skip to Content
Menu
This question has been flagged

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`

Avatar
Discard
Best Answer

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)

Avatar
Discard
Best Answer

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>

Avatar
Discard
Related Posts Replies Views Activity
2
Jan 17
3793
6
Jun 16
5369
0
Feb 16
2389
0
Nov 15
2725
1
Sep 15
3366