[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
This commit is contained in:
Goffin Simon
2016-12-14 11:53:34 +01:00
parent 2d0ff8afa4
commit 169b396c3f
+1 -1
View File
@@ -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')