[IMP] product: fnct_inv of image variant
Doesn't seem to have much effect, but it's probably still better to not have 3 UPDATE run every time we create a new product.product.
This commit is contained in:
parent
f5dd09dd84
commit
443c38dbc0
|
@ -946,12 +946,12 @@ class product_product(osv.osv):
|
|||
|
||||
def _set_image_variant(self, cr, uid, id, name, value, args, context=None):
|
||||
image = tools.image_resize_image_big(value)
|
||||
res = self.write(cr, uid, [id], {'image_variant': image}, context=context)
|
||||
|
||||
product = self.browse(cr, uid, id, context=context)
|
||||
if not product.product_tmpl_id.image:
|
||||
product.write({'image_variant': None})
|
||||
product.product_tmpl_id.write({'image': image})
|
||||
return res
|
||||
if product.product_tmpl_id.image:
|
||||
product.image_variant = image
|
||||
else:
|
||||
product.product_tmpl_id.image = image
|
||||
|
||||
def _get_price_extra(self, cr, uid, ids, name, args, context=None):
|
||||
result = dict.fromkeys(ids, False)
|
||||
|
|
Loading…
Reference in New Issue