From 8f6cd40c7b289b20ef3295e6987beee777c78a3b Mon Sep 17 00:00:00 2001 From: ljain112 Date: Sat, 12 Jul 2025 13:07:52 +0530 Subject: [PATCH] chore: return doc if item already exists for test (cherry picked from commit e6b9e82b2fba369edabec85383680a6e4d2a3e1c) --- erpnext/stock/doctype/batch/test_batch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py index e678f3be3e2..1d44d19ac81 100644 --- a/erpnext/stock/doctype/batch/test_batch.py +++ b/erpnext/stock/doctype/batch/test_batch.py @@ -38,6 +38,8 @@ class TestBatch(FrappeTestCase): if not frappe.db.exists("Item", item_name): return make_item(item_name, dict(has_batch_no=1, create_new_batch=1, is_stock_item=1)) + return frappe.get_doc("Item", item_name) + def test_purchase_receipt(self, batch_qty=100): """Test automated batch creation from Purchase Receipt""" self.make_batch_item("ITEM-BATCH-1")