From de3d90c5ab8866cf3e2fd5b77779580346a0156b Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 3 Sep 2020 14:41:05 +0530 Subject: [PATCH] fix: Item Alternative Test (cherry picked from commit 964de1fc69b32d377f8c2a6f15d6ab7381669606) --- .../item_alternative/test_item_alternative.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item_alternative/test_item_alternative.py b/erpnext/stock/doctype/item_alternative/test_item_alternative.py index 32c58c5ae1..b8f4803c26 100644 --- a/erpnext/stock/doctype/item_alternative/test_item_alternative.py +++ b/erpnext/stock/doctype/item_alternative/test_item_alternative.py @@ -16,6 +16,9 @@ from erpnext.manufacturing.doctype.production_plan.test_production_plan import m from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record from erpnext.manufacturing.doctype.work_order.work_order import make_stock_entry from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + EmptyStockReconciliationItemsError, +) from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( create_stock_reconciliation, ) @@ -180,9 +183,12 @@ def make_items(): if not frappe.db.exists("Item", item_code): create_item(item_code) - create_stock_reconciliation( - item_code="Test FG A RW 1", warehouse="_Test Warehouse - _TC", qty=10, rate=2000 - ) + try: + create_stock_reconciliation( + item_code="Test FG A RW 1", warehouse="_Test Warehouse - _TC", qty=10, rate=2000 + ) + except EmptyStockReconciliationItemsError: + pass if frappe.db.exists("Item", "Test FG A RW 1"): doc = frappe.get_doc("Item", "Test FG A RW 1")