[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
This commit is contained in:
Quentin (OpenERP) 2014-03-18 13:27:26 +01:00
parent e202c84b27
commit 835fbef798
2 changed files with 2 additions and 8 deletions

View File

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

View File

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