uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False):
res = self.product_id_change(cursor, user, 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)
if 'product_uom' in res['value']:
del res['value']['product_uom']
if not uom:
res['value']['price_unit'] = 0.0
return res
Look at this on_change, 15 parameters and calling another one with 14 parameters. This is too much, a good idea will be to use dictionaries:
def product_uom_change(self, cursor, user, ids, params, context=None):
res = self.product_id_change(cursor, user, ids, params, context=context)
if 'product_uom' in res['value']:
del res['value']['product_uom']
if not params['uom']:
res['value']['price_unit'] = 0.0
return res
PS: Here I have also a context parameter, OpenERP and his CEO Fabien Pinckaers forget it frequently.

