[FIX] product: fix _set_price_extra method
avoid crash is context is None create call does not have ids parameter
This commit is contained in:
parent
f911d213b0
commit
b4f72fba96
|
@ -344,6 +344,8 @@ class product_attribute_value(osv.osv):
|
|||
return result
|
||||
|
||||
def _set_price_extra(self, cr, uid, id, name, value, args, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if 'active_id' not in context:
|
||||
return None
|
||||
p_obj = self.pool['product.attribute.price']
|
||||
|
@ -351,7 +353,7 @@ class product_attribute_value(osv.osv):
|
|||
if p_ids:
|
||||
p_obj.write(cr, uid, p_ids, {'price_extra': value}, context=context)
|
||||
else:
|
||||
p_obj.create(cr, uid, p_ids, {
|
||||
p_obj.create(cr, uid, {
|
||||
'product_tmpl_id': context['active_id'],
|
||||
'value_id': id,
|
||||
'price_extra': value,
|
||||
|
|
Loading…
Reference in New Issue