diff --git a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py index c551fdc5904a..93ba90ad9f99 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py @@ -167,7 +167,7 @@ def get_test_item_qty(pos_profile): item_group="All Item Groups", ) - test_item_qty = [item for item in test_item_pos["items"] if item["item_code"] == "_Test Item"][0][ - "actual_qty" - ] + test_item_qty = [item for item in test_item_pos["items"] if item["item_code"] == "_Test Item"][ + 0 + ].get("actual_qty") return test_item_qty