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

XML View error: Element field has extra content: xpath, line 51

By
M. Carmo Leal
on 10/8/14, 6:52 AM 3,498 views

Hi,

I had the following inherited view working on OpenERP 7, but I get this error when I try to install the corresponding module in Odoo 8 and I can't see what's wrong with the xpath. Can anybody help? Thanks.

Error:

File "lxml.etree.pyx", line 3313, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:159862) AssertionError: Element field has extra content: xpath, line 51

View:

<!-- ======================================================    -->
    <!--                      ORDER FORM                    -->
    <!-- ======================================================    -->
    <record model="ir.ui.view" id="view_order_form_multiple_discount">
            <field name="name">sale.order.multiple.discount</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                
            <field name="discount" position="replace">
                <group col="8" colspan="6">
                    <field name="discount" invisible="1"/>
                    <newline/>
                    <field name="desconto1" on_change="onchange_desconto(desconto1,desconto2,desconto3,  price_unit, product_uom_qty, tax_id)"/>
                    <field name="val_desconto1" invisible="True"/>
                    <field name="desconto2" on_change="onchange_desconto(desconto1,desconto2,desconto3,  price_unit, product_uom_qty, tax_id)"/>
                    <field name="val_desconto2" invisible="True"/>
                    <field name="desconto3" on_change="onchange_desconto(desconto1, desconto2,desconto3, price_unit, product_uom_qty, tax_id)"/>
                    <field name="val_desconto3" invisible="True"/>
                </group>
            </field>
            
            <xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='price_unit']" position="replace">
              <field name="price_unit" on_change="onchange_desconto(desconto1,desconto2,desconto3,  price_unit, product_uom_qty, tax_id)"/>
            </xpath>
            
            <xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='discount']" position="replace">
              <field name="desconto1" on_change="onchange_desconto(desconto1,desconto2,desconto3,  price_unit, product_uom_qty, tax_id)"/>
              <field name="val_desconto1" invisible="True"/>
              <field name="desconto2" on_change="onchange_desconto(desconto1,desconto2,desconto3,  price_unit, product_uom_qty, tax_id)"/>
              <field name="val_desconto2" invisible="True"/>
              <field name="desconto3" on_change="onchange_desconto(desconto1, desconto2,desconto3, price_unit, product_uom_qty, tax_id)"/>
              <field name="val_desconto3" invisible="True"/>
            </xpath>
            
            <field name="discount" class="oe_inline"/> %%

                <field name="amount_untaxed" position="after">
                    <group col="8" colspan="2">
                        <field name="tot_desconto1" readonly="1"/>
                        <newline/>
                        <field name="tot_desconto2" readonly="1"/>
                        <newline/>
                        <field name="tot_desconto3" readonly="1"/>
                        <newline/>
                        <field name="rounded" readonly="1"/>
                        <field name="tot_val_desconto1" invisible="True"/>
                        <field name="tot_val_desconto2" invisible="True"/>
                        <field name="tot_val_desconto3" invisible="True"/>
                        <field name="tot_rounded" invisible="True"/>
                    </group>
                </field>
            </field>
    </record>

 

 

0

Maniganda

--Maniganda--
1038
| 5 7 7
Bangalore, India
--Maniganda--
Maniganda
On 10/8/14, 8:42 AM

Hi I think the problem, with this line

 <field name="discount" class="oe_inline"/> %%

the field is not either in xpath nor there is no position for the field discount

 

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: 10/8/14, 6:52 AM
Seen: 3498 times
Last updated: 3/16/15, 8:10 AM