From 2ce37c2ba9f6d89f4552598b08e91b694b01d424 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 10 Sep 2013 00:31:55 +0200 Subject: [PATCH] [FIX] stock: quants_get made deterministic when two quants have exactly the same date (same second) bzr revid: qdp-launchpad@openerp.com-20130909223155-5k2k0ongk2idtt5n --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 6bb2d471291..4b9b28409fd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -371,6 +371,8 @@ class stock_quant(osv.osv): domain += [('product_id','=',product.id)] + domain res = [] offset = 0 + #id is added at the end of the order to make sure the order is always the same for quants created at the same second + orderby += ', id' while quantity > 0: quants = self.search(cr, uid, domain, order=orderby, limit=10, offset=offset, context=context) if not quants: