test(stock): add test to check from warehouse for issue type

(cherry picked from commit da0322e994)
This commit is contained in:
Pandiyan37
2026-02-09 13:06:27 +05:30
committed by Mergify
parent 53e512ceaf
commit 8c4a9040b7

View File

@@ -1104,6 +1104,19 @@ class TestMaterialRequest(IntegrationTestCase):
self.assertRaises(frappe.ValidationError, end_transit_2.submit)
def test_make_stock_entry_material_issue_warehouse_mapping(self):
"""Test to ensure while making stock entry from material request of type Material Issue, warehouse is mapped correctly"""
mr = make_material_request(material_request_type="Material Issue", do_not_submit=True)
mr.set_warehouse = "_Test Warehouse - _TC"
mr.save()
mr.submit()
se = make_stock_entry(mr.name)
self.assertEqual(se.from_warehouse, "_Test Warehouse - _TC")
self.assertIsNone(se.to_warehouse)
se.save()
se.submit()
def get_in_transit_warehouse(company):
if not frappe.db.exists("Warehouse Type", "Transit"):