Odoo Help


inherit product onchange function in sale order line

veena vasudevan
on 11/28/13, 11:47 PM 2,857 views

how to inherit product onchange function in sale order line

Anil R. Kesariya
On 11/29/13, 6:16 AM

Hello veena vasudevan,

Function can be override not inherit. for overriding you need to inherit that model.

here is the sample code to override your funciton.

In your custom py file

class sale_order_line(osv.osv)

_inherit = 'sale.order.line'

def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
        uom=False, qty_uos=0, uos=False, name='', partner_id=False,
        lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):

     #your code for changes

     res = super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty=qty,
        uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
        lang=lang, update_tax=update_tax, date_order= date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context):

      #your code for changes
 return res

By this way use can override the on change function.

Hope this will help.


Anil Kesariya

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: 11/28/13, 11:47 PM
Seen: 2857 times
Last updated: 3/16/15, 8:10 AM