跳至内容
菜单
此问题已终结

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>

形象
丢弃
相关帖文 回复 查看 活动
2
1月 17
4686
6
6月 16
6351
0
2月 16
3306
0
11月 15
3496
1
9月 15
4197