fix(test): test_stock_reservation_against_sales_order

This commit is contained in:
s-aga-r
2023-06-01 17:00:57 +05:30
parent 4eb2717c3b
commit 4044c2ed40
2 changed files with 34 additions and 14 deletions

View File

@@ -1890,11 +1890,11 @@ class TestSalesOrder(FrappeTestCase):
)
from erpnext.stock.doctype.stock_reservation_entry.test_stock_reservation_entry import (
create_items,
create_material_receipts,
create_material_receipt,
)
items_details, warehouse = create_items(), "_Test Warehouse - _TC"
create_material_receipts(items_details, warehouse, qty=10)
se = create_material_receipt(items_details, warehouse, qty=10)
item_list = []
for item_code, properties in items_details.items():
@@ -1932,8 +1932,10 @@ class TestSalesOrder(FrappeTestCase):
self.assertEqual(item.stock_reserved_qty, sre_details[0].reserved_qty)
self.assertEqual(sre_details[0].status, "Partially Reserved")
se.cancel()
# Test - 3: Stock should be fully Reserved if the Available Qty to Reserve is greater than the Un-reserved Qty.
create_material_receipts(items_details, warehouse, qty=100)
create_material_receipt(items_details, warehouse, qty=110)
so.create_stock_reservation_entries()
so.load_from_db()