From b2eb54abe5c616ab62ac936d659ba911ef69012c Mon Sep 17 00:00:00 2001 From: Kinjal Mehta Date: Mon, 9 May 2016 11:44:02 +0530 Subject: [PATCH] [IMP] product: order the attribute values by sequence then by id ======= purpose ======= By default, the sequence is 0 for all new attributes and the result is messed up. The product attribute values are not ordered in the same way in a list view. That's because the results are not returned from sql ordered by id if the sequence is the same. Just add this in the order definition will remove the non-deterministic behavior. --- 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 e215c4c537e..9c9a8c09388 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' + _order = 'sequence, id' name = fields.Char('Value', required=True, translate=True) sequence = fields.Integer('Sequence', help="Determine the display order")