Odoo Help


How to modify xpath from other xpath? (inherit from inherited view)

Dedi Sinaga
on 1/26/14, 11:24 PM 4,472 views

I have two modules, first module add a field in sale.order.line using xpath :

<record id="view_order_property_form_view" model="ir.ui.view">
            <field name="name">sale.order.property.form</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                        <xpath expr="/form/sheet/notebook/page[@string='Order Lines']/field[@name='order_line']/tree/field[@name='product_id']" position="after">
                                    <field name="property_id" on_change="onchange_property_id(property_id)" domain="[('state','=','for_sale'),('availability','=','available')]"/>
            </field> </record>

I want to modify the domain in field property_id using second module without modifying the first module. Is it possible? If it is possible, how to do it?

Thanks in advance.

Sunny Dabgar
On 10/6/16, 12:09 AM

You can use

<xpath  expr="//field[@name='property_id'] position='attributes'>

     <attribute name='domain'>[YOUR NEW DOMAIN]</attribute>





| 3 2 6
Gandhinagar, India

Having 8+ years of OpenERP Experience. We are Specialized in OpenERP/CRM Solutions, software development, Web development, E commerce solutions & other open source solutions.

Skype : acespritech

Email : info@acespritech.com

On 1/27/14, 2:47 AM


You just need to inherit view_order_property_form_view in second module and then you need to give xpath for property_id and then by applying position='attributes' in xpath you will be able to change domain on that field.


I know about the attributes position, but how to write the xpath expression? <xpath expr="?" position="attributes"> </xpath>

Dedi Sinaga
on 1/27/14, 4:55 AM

You can apply same xpath. Instead of product_id you just need to define property_id.

on 1/27/14, 6:40 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

1 follower(s)


Asked: 1/26/14, 11:24 PM
Seen: 4472 times
Last updated: 8/28/17, 1:02 PM