[FIX] website_sale: attribute conflict with m2m tags color
The color field of a product.attribute.value enable users to choose a color with its HTML color value (hexa, named, rgb, rgba). In the many2many tags the color field on the model has a magic feature which color the tag in several instances. But these color are numbered from 0 to 10 and are incompatible with HTML color values. So with with the model product.attribute.value, the many2many tags widget would use the color system (since a field name color exists), and when setting a color with it, it would be invalid and erase the wanted named or HTML value color. This fix ignore the setting of the tag color for this particular model, a following fix (in master) should rename the column to properly fix this. opw-653124
This commit is contained in:
@@ -190,3 +190,10 @@ class product_attribute_value(osv.Model):
|
||||
_columns = {
|
||||
'color': fields.char("HTML Color Index", help="Here you can set a specific HTML color index (e.g. #ff0000) to display the color on the website if the attibute type is 'Color'."),
|
||||
}
|
||||
|
||||
# TODO in master: remove this function and change 'color' field name
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
# ignore write coming from many2many_tags color system
|
||||
if vals.keys() == ['color'] and isinstance(vals['color'], (int, long)):
|
||||
vals = {}
|
||||
return super(product_attribute_value, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
Reference in New Issue
Block a user