There is a problem in Odoo 8 while trying to add a new field in sale order line, the form simply doesn't save, I don't if anything's wrong with my code. I am attaching my code here:
The sale_view.xml:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_order_line_tree_inherited" model="ir.ui.view">
<field name="name">sale.order.line.tree.inherited</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name='no_end_product'/>
<field name='length'/>
<field name='width'/>
</xpath>
</field>
</record>
</data>
The sale.py:
import logging
from openerp.osv import fields, osv
from openerp import tools
from openerp.tools.translate import _
class sale_order_line(osv.osv):
_inherit='sale.order.line'
_columns= {
'length': fields.float("Length"),
'width': fields.float("Width"),
'no_end_product': fields.integer("End Product No."),
}
sale_order_line()
However the same code works fine in Openerp 7, I wonder what's creating a problem in Odoo 8.Any quick fix would be greatly appreciated.
Thanks And Regards, Yaseen Shareef
Aucun commentaire:
Enregistrer un commentaire