mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
more stock_reserve tests
* check that multiple reservations are handled correctly * check that various UOM are handled correctly
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user