[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:
Xavier Morel 2015-06-24 11:37:21 +02:00
parent f5dd09dd84
commit 443c38dbc0
1 changed files with 5 additions and 5 deletions

View File

@ -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)