[FIX] warning: onchange_product method signature

Module 'Warning' overwrites onchange_product_id method of purchase.order.line

The signature in the warning module had 'notes', while there isn't any 'notes'
parameter in the original method, in the purchase module.

The super call was also wrong, ignoring the optional fields, which
were therefore always set to the default value
This commit is contained in:
Denis Ledoux 2015-02-16 15:01:12 +01:00
parent 11bd7a6774
commit 4606b4535a
1 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,7 @@ class purchase_order_line(osv.osv):
_inherit = 'purchase.order.line'
def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
name=False, price_unit=False, notes=False, context=None):
name=False, price_unit=False, context=None):
warning = {}
if not product:
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'notes': notes or '', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
@ -322,7 +322,7 @@ class purchase_order_line(osv.osv):
return {'value': {'product_id': False}, 'warning': warning}
result = super(purchase_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order, fiscal_position_id)
partner_id, date_order, fiscal_position_id, date_planned, name, price_unit, context=context)
if result.get('warning',False):
warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title']