From 835fbef7987254012ebc35af15cae9147e8a5678 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 18 Mar 2014 13:27:26 +0100 Subject: [PATCH] [FIX] stock: now, the behavior fifo/lifo IS garanteed even if quants are created at the same second bzr revid: qdp-launchpad@openerp.com-20140318122726-ggjm0sxn8lzzl3pb --- addons/stock/stock.py | 4 ++-- addons/stock_dropshipping/test/lifo_price.yml | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dd81a8e879d..b1e6b00213d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -571,11 +571,11 @@ class stock_quant(osv.osv): return res def _quants_get_fifo(self, cr, uid, location, product, quantity, domain=[], context=None): - order = 'in_date' + order = 'in_date, id' return self._quants_get_order(cr, uid, location, product, quantity, domain, order, context=context) def _quants_get_lifo(self, cr, uid, location, product, quantity, domain=[], context=None): - order = 'in_date desc' + order = 'in_date desc, id desc' return self._quants_get_order(cr, uid, location, product, quantity, domain, order, context=context) def _location_owner(self, cr, uid, quant, location, context=None): diff --git a/addons/stock_dropshipping/test/lifo_price.yml b/addons/stock_dropshipping/test/lifo_price.yml index 1ab280350e8..b54e6529405 100644 --- a/addons/stock_dropshipping/test/lifo_price.yml +++ b/addons/stock_dropshipping/test/lifo_price.yml @@ -74,12 +74,6 @@ - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_lifo2} - - The behavior of fifo/lifo is not garantee if the quants are created at the same second, so i just wait one second -- - !python {model: stock.picking}: | - import time - time.sleep(1) -- Process the reception of purchase order 2 - !python {model: stock.picking}: |