python - Adding New Field In order line Odoo 8 -
there problem in odoo 8 while trying add new field in sale order line, form doesn't save, don't if anything's wrong code. attaching 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 openerp.osv import fields, osv openerp import tools 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 same code works fine in openerp 7, wonder what's creating problem in odoo 8.any quick fix appreciated.
thanks , regards, yaseen shareef
here's list of things miss when wondering why changes don't take effect:
- import module .py files in init.py
- add xml file __openerp__.py
- upgrade module after changes affecting db/views
- if new module, install it. make sure not ignored, because module list has not been updated.
a simple way check if odoo ignoring files entirely introduce error in them , see if error pop in logs.
Comments
Post a Comment