From 4606b4535a1f1900497845ff97706ce00e819205 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 16 Feb 2015 15:01:12 +0100 Subject: [PATCH] [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 --- addons/warning/warning.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/warning/warning.py b/addons/warning/warning.py index b4e3c5a116d..926974dee4f 100644 --- a/addons/warning/warning.py +++ b/addons/warning/warning.py @@ -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']