more stock_reserve tests

* check that multiple reservations are handled correctly
* check that various UOM are handled correctly
This commit is contained in:
Alexandre Fayolle
2014-09-08 15:36:29 +02:00
parent 25c434cd4c
commit 7e81c6c314

View File

@@ -33,18 +33,31 @@
product_id: product_sorbet
product_uom_qty: 6.0
product_uom: product.product_uom_kgm
name: reserve 6 kgm of sorbet for test
name: reserve 6 kg of sorbet for test
-
I confirm the reservation
-
!python {model: stock.reservation}: |
self.reserve(cr, uid, [ref('reserv_sorbet1')], context=context)
-
I create a stock reservation for 500g
-
!record {model: stock.reservation, id: reserv_sorbet2}:
product_id: product_sorbet
product_uom_qty: 500
product_uom: product.product_uom_gram
name: reserve 500g of sorbet for test
-
I confirm the reservation
-
!python {model: stock.reservation}: |
self.reserve(cr, uid, [ref('reserv_sorbet2')], context=context)
-
I check Virtual stock of Sorbet after update reservation
-
!python {model: product.product}: |
product = self.browse(cr, uid, ref('stock_reserve.product_sorbet'), context=context)
assert product.virtual_available == 4, "Stock is not updated."
assert product.virtual_available == 3.5, "Stock is not updated."
-
I release the reservation
-
@@ -55,4 +68,4 @@
-
!python {model: product.product}: |
product = self.browse(cr, uid, ref('stock_reserve.product_sorbet'), context=context)
assert product.virtual_available == 10, "Stock is not updated."
assert product.virtual_available == 9.5, "Stock is not updated."