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

amount_untaxed not found by xpath in sale.view_order_form

By
E.M.
on 2/7/16, 1:37 PM 394 views
Any idea on why amount_untaxed is not found in sale.view_order_form
Error details: Element '<xpath expr="//field[@name]='amount_untaxed'">' can not be located in parent view 
Context error: View `Total Amount Discount Fields for Sale Order Form` [view_id: 995, xml_id: n/a, model: sale.order, parent_id: 575]" while parsing /usr/lib/python2.7/dist-packages/openerp/addons/custom/discount_from_total/views/sale_order_form.xml:4, near
<record id="discount_from_total_in_sale_order_form" model="ir.ui.view"> <field name="name">Total Amount Discount Fields for Sale Order Form</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <xpath expr="//field[@name]='amount_untaxed'" position="after"> <field name="amount_discount"/> </xpath> </field> </record>
1

Axel Mendoza

--Axel Mendoza--
10318
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 2/7/16, 4:45 PM

You have an error in your xpath expression, it should be:

<xpath expr="//field[@name='amount_untaxed']" position="after">
    <field name="amount_discount"/>
</xpath>

you could also use it like this instead of using an xpath:

<field name="amount_untaxed" position="after">

<field name="amount_discount"/>

</field>

I finally realized my xpath was wrong. Unfortunatelly I was following "Odoo Development Essentials" book which actually had a mistake and used this wrong xpath.

E.M.
on 2/8/16, 2: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

1 follower(s)

Stats

Asked: 2/7/16, 1:37 PM
Seen: 394 times
Last updated: 2/8/16, 2:01 AM