projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f911d21
)
[FIX] product: fix _set_price_extra method
author
Guewen Baconnier
<guewen@users.noreply.github.com>
Tue, 3 Jun 2014 12:19:51 +0000
(14:19 +0200)
committer
Martin Trigaux
<mat@openerp.com>
Tue, 3 Jun 2014 12:19:51 +0000
(14:19 +0200)
avoid crash is context is None
create call does not have ids parameter
addons/product/product.py
patch
|
blob
|
history
diff --git
a/addons/product/product.py
b/addons/product/product.py
index
79c74a6
..
6313237
100644
(file)
--- a/
addons/product/product.py
+++ b/
addons/product/product.py
@@
-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,