From 169b396c3f330bb62797fa5a4aeb715175c345c6 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 14 Dec 2016 11:15:56 +0100 Subject: [PATCH] [FIX] product: Persistant order on product variant The order of variants(product.product) is (re)defined each time the attributes of a product.template are modified. The order of these variants is computed according to the order defined on "product.product" which is ordered by 'default_code,name_template' and also the sequence of the product.attribute.value. But when a new product.attribute is created, the default sequence is the order of creation of your new values. So if the sequence of the attributes is changed after modifying the product.template, the new sequence will not have any impact on the order of the variants. The sequence of the attributes must be defined first before modifying the attributes on a product.template to have an impact on it. opw:693135 --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index fed52c552ec..535b9df23be 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -778,7 +778,7 @@ class product_product(osv.osv): _description = "Product" _inherits = {'product.template': 'product_tmpl_id'} _inherit = ['mail.thread'] - _order = 'default_code,name_template' + _order = 'default_code,name_template,id' def _product_price(self, cr, uid, ids, name, arg, context=None): plobj = self.pool.get('product.pricelist')