[FIX] website_sale: product attribute line

In e-commerce, on a product page. If the product has some attributes
("product.attribute.line" model) with several values for at least one attribute
(which means several variants for one product), the display of these attributes must
respect the sequence defined in:
Sales > configuration > products > attributes("product.attribute" model)

opw:648634
This commit is contained in:
Goffin Simon
2015-09-08 14:23:40 +02:00
parent 19a523ff64
commit d7eb2c0397
+1 -1
View File
@@ -415,7 +415,7 @@
<template id="variants">
<t t-set="attribute_value_ids" t-value="get_attribute_value_ids(product)"/>
<ul t-attf-class="list-unstyled js_add_cart_variants #{ul_class}" t-att-data-attribute_value_ids="attribute_value_ids">
<t t-foreach="product.attribute_line_ids" t-as="variant_id">
<t t-foreach="product.attribute_line_ids.sorted(key=lambda x: x.attribute_id.sequence)" t-as="variant_id">
<li t-if="len(variant_id.value_ids) > 1">
<strong t-field="variant_id.attribute_id.name"/>