From 70e1efd41e6433ab2e010fdd923ff0d3683504c0 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 8 May 2017 18:50:43 +0200 Subject: [PATCH] [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 834b38a84d658f6f0dc42d32e6cd983301a70b71. 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. --- addons/product/models/product_attribute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product_attribute.py b/addons/product/models/product_attribute.py index 9c9a8c09388..cffefbbda13 100644 --- a/addons/product/models/product_attribute.py +++ b/addons/product/models/product_attribute.py @@ -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")