Odoo Help


Adding custom field to sales order product lines?

Clemens Kroell
on 1/17/14, 6:42 AM 1,230 views


i try to add a custom text field "detail" to the product lines in a sales order. i created a new module and added the following code:


import sales_order_detail_field


from openerp.osv import fields, osv

class sales_order_detail_field(osv.Model):
        _name = 'sale.order'
        _inherit = 'sale.order.line'
        _columns = {
                'detail': fields.text('Detail'),



<?xml version="1.0" encoding="utf-8"?>
   <record model="ir.ui.view" id="detail_field_in_view">
    <field name="name">New Sale Order field detail</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='order_line']/form/notebook/page[@string='Order Line']//field[@name='product_uom_qty' ]" position="before">
        <field name="detail" />

but when i reload my openerp window, i jus tget the following error

raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Fehler w\xe4hrend der Pr\xfcfung des Feldes field(s) arch: Invalid XML for View Architecture!')

any advice what's wrong here? maybe the xml?


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: 1/17/14, 6:42 AM
Seen: 1230 times
Last updated: 3/16/15, 8:10 AM