Odoo Help


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.


Tracing module update for inheritance in views

on 11/14/13, 5:39 AM 1,241 views

I'm trying to manipulate the sale form by a module with inheritance in views. I have following XML for testing:

<?xml version="1.0" encoding="utf-8"?>
        <record id="view_order_form" model="ir.ui.view">
            <field name="name">sale.order.form.custom.120</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                    <field name="invoiced" position="replace"/>
                        expr="//page[@string='Order Line']/field[@name='product_uom_qty']" 

AFAIK that should remove the quantity field from the form. But it won't.

I tested the XPath expression wit a query tool. Should be fine.

Is there any debug/trace level to see what happens, when reading this XML to update the view ?

(Updates removed, as incorrect)

Timo Talvitie
On 11/14/13, 9:09 AM

We had some issues with sale order view customizations not showing up properly and it was because of the loading order between sale, sale_stock and the custom modules. Setting the custom modules to depend on sale_stock instead of sale fixed the issue. Perhaps your issue is related if you currently have sales and warehouse management functionalities installed.

You were right, in my case sale_layout puts the field again into the form.

on 11/15/13, 4:15 AM

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 11/14/13, 6:18 AM

Hello Peterm,

Your xpath seems wrong.

Try this xpath:

<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/tree/field[@name='product_uom_qty']" position="replace"></xpath>
<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/form/group/group/label[@for='product_uom_qty']" position="replace"></xpath>
<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/form/group/group/div/field[@name='product_uom_qty']" position="replace"></xpath>

Then update your module.

Hope this will solve your problem.


Serpent Consulting Services.

None of them works for me. So asking again, is there a trace option or where OE reads and proceses the xpath expression to add a trace there to see what happens.

on 11/14/13, 6:37 AM

What error are you facing?

Serpent Consulting Services Pvt. Ltd.
on 11/14/13, 6:44 AM

Updating the module, the field keeps on the form (should be removed) as nothing was done. If I provoke an error in the XML I get an error message. That means my XML is read on update ...

on 11/14/13, 6:46 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

0 follower(s)


Asked: 11/14/13, 5:39 AM
Seen: 1241 times
Last updated: 3/16/15, 8:10 AM