[FIX] website_sale: rename conflicted color field

'color' is now a kind of magic field for the many2many tags widget, it
should not be used for something else.

This was half-fixed in 9.0 with f847701 and this commit solves it
properly.

opw-653124
This commit is contained in:
Nicolas Lempereur
2015-11-09 16:07:07 +01:00
parent fac4127470
commit 91d9625d9b
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -188,5 +188,7 @@ class product_attribute(osv.Model):
class product_attribute_value(osv.Model):
_inherit = "product.attribute.value"
_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'."),
'html_color': fields.char("HTML Color Index", oldname='color', 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'."),
}
+2 -2
View File
@@ -293,7 +293,7 @@
</t>
<t t-if="a.type == 'color'">
<t t-foreach="a.value_ids" t-as="v">
<label t-attf-style="background-color:#{v.color or v.name}"
<label t-attf-style="background-color:#{v.html_color or v.name}"
t-attf-class="css_attribute_color #{'active' if v.id in attrib_set else ''}">
<input type="checkbox"
name="attrib"
@@ -515,7 +515,7 @@
<ul class="list-inline">
<t t-set="inc" t-value="0"/>
<li t-foreach="variant_id.value_ids" t-as="value_id">
<label t-attf-style="background-color:#{value_id.color or value_id.name}"
<label t-attf-style="background-color:#{value_id.html_color or value_id.name}"
t-attf-class="css_attribute_color #{'active' if not inc else ''}">
<input type="radio" class="js_variant_change"
t-att-checked="'checked' if not inc else ''"
+2 -2
View File
@@ -43,7 +43,7 @@
<field name="inherit_id" ref="product.product_attribute_value_view_tree"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="color"/>
<field name="html_color"/>
</field>
</field>
</record>
@@ -53,7 +53,7 @@
<field name="inherit_id" ref="product.variants_tree_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="color"/>
<field name="html_color"/>
</field>
</field>
</record>