How to inherit Sale Order line in odoo

.py file

class sale_line(osv.osv):
 def _getcost(self,cr,uid,ids,name,arg,context=None):
 res = {}
 for resource in self.browse(cr,uid,ids,context=context):
 res[]= resource.product_id.standard_price
 return res
 _columns ={

.xml file

<record id="sale_view_order_line_form" model="ir.ui.view">
 <field name="name">Sale Order Line</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']/tree//field[@name='price_unit']" position="after">
 <field name="standard_price" string="Cost"/>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s