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.


Add column to Sales Order Lines, ValidateError

on 7/10/13, 11:43 PM 1,647 views

Hi all,

I am trying to add a new column into Sales Order Lines (the Order Lines page in Quotation/Sales Order). I have tried different codes..but couldn't get rid of the ValidateError.. I have attached my codes below.. much appreciate your kind advice!


from openerp.osv import fields, osv

class sale_order(osv.osv):

   'country':fields.char('Country', size=32),


<openerp> <data>

    <record model="ir.ui.view" id="moleac_quotation_form_view">
        <field name="name">Quotation Inherited View</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" /> 
            <field name="arch" type="xml">
                    <!--Order Line-->
                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='product_id']" position="after">
                        <field name="country" />



I also tried...but it did not work

                    <!--Order Line-->
                    <field name="tax_id" position="before"> 
                        <field name="country" />
On 7/11/13, 2:10 AM

Well I think I still have very obscure understanding about the code structure....so if the fixes I did to make things work are not proper, please kindly correct me. :]

I guess I made two mistakes:

  1. the item shall be declared in sale order line class, rather than sale order class
  2. the sales lines view in the product page is actually the tree list rather than the form view defined in the view_order_form

It worked by adding:

<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='tax_id']" position="after"> <field name="test2"/> </xpath>

This works perfect, but when you add this you can't change the value of the new field because it's not in the Product view. Need to change that

on 10/8/15, 5:59 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: 7/10/13, 11:43 PM
Seen: 1647 times
Last updated: 3/16/15, 8:10 AM