تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5 الردود
4955 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 25
1262
0
يناير 25
3305
1
أغسطس 23
14609
change password تم الحل
1
أغسطس 23
13253
1
يوليو 23
10270