[FIX] product: non-random default variant attribute order

Before this revision, if the user did not re-order
the sequence of its attribute values manually,
the attributes in the variant name were ordered
randomly.
e.g. On the ipod, one time it could be the color before
the GB, one time the other way around.

Besides, this could lead to an issue in the pivot table,
as mentioned in the revision
834b38a84d.

However, on the contrary on what is done in the above revision,
these attributes must not be ordered on their value name,
but rather on their sequence, and if they have the same,
on their attribute, so the order is always deterministic.
This commit is contained in:
Denis Ledoux
2017-07-06 10:41:00 +02:00
committed by Thibault Delavallée
parent 4613455d45
commit 70e1efd41e
+1 -1
View File
@@ -20,7 +20,7 @@ class ProductAttribute(models.Model):
class ProductAttributevalue(models.Model):
_name = "product.attribute.value"
_order = 'sequence, id'
_order = 'sequence, attribute_id, id'
name = fields.Char('Value', required=True, translate=True)
sequence = fields.Integer('Sequence', help="Determine the display order")