Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
5046 Lượt xem

Hello:

Please, i want to add a field in the class "account invoice" but under this: 

<notebook colspan="4">

<page string="Invoice Lines">

<field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">

<tree string="Invoice Lines" editable="bottom">

<field name="field"/>

Howcan i use xpath to locate it please.

Thanks a lot in advance

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

you can also do it in another way

if you can not fine the technical name of the field

you can do it with the string name

<xpath expr="//field[@string='String_Name']" position="after">
<field name="field_name"/>
</xpath>

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

Here is the answer:

<xpath expr="//field[@name='invoice_line']/tree/field[@name='product_id']"

position="before">

<field name="project_name"/>

</xpath>

I have tried it and it works perfectly :)

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

same as it works in prior versions :) xpath is working with any xml file.. it is not related to odoo version :)

hi, where can I read the docs about xpath?

Doesn't seem to be too much documentation about xpath. A bit of info here: https://www.odoo.com/documentation/8.0/reference/views.html

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 25
1420
0
thg 1 25
3501
1
thg 8 23
14868
change password Đã xử lý
1
thg 8 23
13514
1
thg 7 23
10497