Odoo Help

Welcome!

This community 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.

0

How to use xpath in odoo v8

By
Drees Far
on 7/14/15, 5:51 AM 756 views

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

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

3

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 7/14/15, 6:50 AM

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

Bole
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

Yenthe
on 7/30/15, 11:00 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

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