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

overriding sales_order_lines?

By
David Brilliant
on 12/16/13, 6:40 PM 1,045 views

trying to override the existing view of sales_order_lines from the form view. Keep getting xml errors here.

<record id="sales_order_line_modified" model="ir.ui.view">
    <field name="name">sale.order.form</field>
    <field name="model">sale.order</field>
    <field name="type">form</field>
    <field name="inherit_id" ref="sale.view_order_form" />
    <field name="arch" type="xml">
        <data>
            <xpath expr="/tree/field[@name='name']" position="replace">
                <field name="name" on_change="onchange_order_line(product_id,name)"/>
            </xpath>
        </data>
    </field>
</record>

Trying to add an on_change method and getting an XML Archetecture error. Any help would be greatly appreciated.

1

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 12/16/13, 9:34 PM

Your code is wrong It's:

<openerp>
    <data>
        <record id="sales_order_line_modified" model="ir.ui.view">
        <field name="name">sale.order.form</field>
        <field name="model">sale.order</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">

             <xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
                 <field name="name" on_change="onchange_order_line(product_id,name)"/>
             </xpath>

        </field>
        </record>
    </data>
</openerp>

Your solution works, but you've got your data tags in the wrong area. They should be around the xpath tags. Once I made this change openERP installed the module just fine. Thanks for your time!

edit: If you make the changes indicated to your post, I'll mark this as correct answer.

David Brilliant
on 12/17/13, 1:46 PM

I'm not sure why it works for you, but data doesn't go inside a XML arch. Anyways I fixed my mistake.

GH Mediacloud, Grover Menacho
on 12/17/13, 2:15 PM

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)

Stats

Asked: 12/16/13, 6:40 PM
Seen: 1045 times
Last updated: 3/16/15, 8:10 AM