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

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

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

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>

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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 :)

อวตาร
ละทิ้ง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
1420
0
ม.ค. 25
3499
1
ส.ค. 23
14867
change password แก้ไขแล้ว
1
ส.ค. 23
13512
1
ก.ค. 23
10493