diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 161ce4e1b4..7e92f53cf4 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -66,7 +66,7 @@ class DocType: item = sql("select name from `tabItem` where ifnull(item_group, '') = %s", self.doc.name) item = [d[0] for d in item] - if ig: + if item: msgprint("""Item Group: %s can not be trashed/deleted because it is used in item: %s. To trash/delete this, remove/change item group in item master""" % (self.doc.name, item or ''), raise_exception=1)