Odoo Help


Add column to Sales Order Lines, ValidateError

on 7/10/13, 11:43 PM 2,447 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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 7/10/13, 11:43 PM
Seen: 2447 times
Last updated: 3/16/15, 8:10 AM