diff options
| author | Denis Ledoux <dle@odoo.com> | 2017-05-08 18:50:43 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2017-07-06 10:41:00 +0200 |
| commit | 70e1efd41e6433ab2e010fdd923ff0d3683504c0 (patch) | |
| tree | b858a122cc875a8ac94cfffb3d1a9b8a78ca528a | |
| parent | 4613455d45372f4037e98b5399fccbcd15ecc29d (diff) | |
[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.
| -rw-r--r-- | addons/product/models/product_attribute.py | 2 |
1 files changed, 1 insertions, 1 deletions
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") |
