diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml index 528ff18ec5b..7233f36ff81 100644 --- a/addons/purchase/test/fifo_price.yml +++ b/addons/purchase/test/fifo_price.yml @@ -359,5 +359,5 @@ !python {model: product.product}: | quant_obj = self.pool.get("stock.quant") quants = quant_obj.search(cr, uid, [('product_id','=',ref("product_fifo_icecream"))]) - print "Quants:", [(x.qty, x.location_id.name, x.product_id.name, x.cost) for x in quant_obj.browse(cr, uid, quants)] + print "Quants:", [(x.qty, x.location_id.name, x.in_date, x.cost) for x in quant_obj.browse(cr, uid, quants)] assert self.browse(cr, uid, ref("product_fifo_icecream")).standard_price == 65.0, "Product price not updated accordingly. %s found instead of 65" %(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price,) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 50e24e71536..176d360569b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -380,7 +380,7 @@ class stock_quant(osv.osv): 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' + orderby += ', id asc' while quantity > 0: quants = self.search(cr, uid, domain, order=orderby, limit=10, offset=offset, context=context) if not quants: