[minor] throw name error if group matches with name, for setup wizard to nicely catch the exception

This commit is contained in:
Rushabh Mehta 2017-07-05 15:12:07 +05:30
parent 949a920022
commit 03c30a7f92

View File

@ -56,7 +56,7 @@ class ItemGroup(NestedSet, WebsiteGenerator):
def validate_name_with_item(self):
if frappe.db.exists("Item", self.name):
frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name))
frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name), frappe.NameError)
def get_context(self, context):
context.show_search=True