[FIX] product: pricelist item deterministic order

On a pricelist, if multiple rules were set with the same
set of rules condition, the choice of which rule/item
is used was random, according to the postgres database
state.

Adding the `id` in the order force to always use the same
rule/item (the first that was created).

opw-744865
This commit is contained in:
Denis Ledoux
2017-06-06 12:55:29 +02:00
parent fef6694442
commit b43151c11c
+1 -1
View File
@@ -268,7 +268,7 @@ class product_pricelist(osv.osv):
class product_pricelist_item(osv.osv):
_name = "product.pricelist.item"
_description = "Pricelist item"
_order = "applied_on, min_quantity desc, categ_id desc"
_order = "applied_on, min_quantity desc, categ_id desc, id"
def _check_recursion(self, cr, uid, ids, context=None):
for obj_list in self.browse(cr, uid, ids, context=context):