[FIX] stock: quants_get made deterministic when two quants have exactly the same date (same second)

bzr revid: qdp-launchpad@openerp.com-20130909223155-5k2k0ongk2idtt5n
This commit is contained in:
Quentin (OpenERP) 2013-09-10 00:31:55 +02:00
parent bf74a4c81e
commit 2ce37c2ba9
1 changed files with 2 additions and 0 deletions

View File

@ -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: