From b59fd430fd71fdc3081a846876ff4d465418fef7 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 18 Sep 2013 15:27:18 +0200 Subject: [PATCH] [FIX] purchase: added a delay of 1 second in fifo_price, as the behavior is not deterministic for quants created the same second bzr revid: qdp-launchpad@openerp.com-20130918132718-oap7zov1z8dqifs3 --- addons/purchase/test/fifo_price.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml index 63b42706191..1b8984c7f89 100644 --- a/addons/purchase/test/fifo_price.yml +++ b/addons/purchase/test/fifo_price.yml @@ -297,6 +297,11 @@ !python {model: stock.picking}: | picking_obj = self.browse(cr, uid, ref("outgoing_fifo_shipment_neg")) picking_obj.do_partial(context=context) +- + The behavior of fifo/lifo is not garantee if the quants are created at the same second, so i just wait one second +- + import time + time.sleep(1) - Let us create another out of 400 kg - @@ -392,4 +397,4 @@ quant_obj = self.pool.get("stock.quant") quants = quant_obj.search(cr, uid, [('product_id','=',ref("product_fifo_negative"))]) print "Quants:", [(x.qty, x.location_id.name, x.in_date, x.cost, x.id) for x in quant_obj.browse(cr, uid, quants)] - assert self.browse(cr, uid, ref("product_fifo_negative")).standard_price == 65.0, "Product price not updated accordingly. %s found instead of 65" %(self.browse(cr, uid, ref("product_fifo_negative")).standard_price,) \ No newline at end of file + assert self.browse(cr, uid, ref("product_fifo_negative")).standard_price == 65.0, "Product price not updated accordingly. %s found instead of 65" %(self.browse(cr, uid, ref("product_fifo_negative")).standard_price,)