Odoo Help


How to use xpath in odoo v8

Vale Trood
on 7/14/15, 5:51 AM 1,400 views


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

Indrabhan Bhamare
On 7/30/15, 11:02 AM

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"/>


Vale Trood

--Vale Trood--

| 5 2 7
Tunis, France
--Vale Trood--

Vale Trood
On 7/14/15, 6:50 AM

Here is the answer:

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


<field name="project_name"/>


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

on 7/14/15, 7:00 AM

hi, where can I read the docs about xpath?

Fanha Giang
on 7/15/15, 8:08 AM

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

on 7/30/15, 11:00 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 7/14/15, 5:51 AM
Seen: 1400 times
Last updated: 11/5/15, 12:29 PM