Reputation: 767
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>
</openerp>
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.
Upvotes: 0
Views: 1910
Reputation: 941
Here's a list of the things I normally miss when wondering why my changes don't take effect:
__init__.py
__openerp__.py
db/views
.A simple way to check if odoo is ignoring the files entirely is to introduce an error in them and see if an error will pop in the logs.
Upvotes: 1