[fix] throw name error for duplicate group

This commit is contained in:
Rushabh Mehta 2015-05-19 13:02:23 +05:30
parent 5495bc54a5
commit 476019a930

View File

@ -76,7 +76,7 @@ class Customer(TransactionBase):
def validate_name_with_customer_group(self): def validate_name_with_customer_group(self):
if frappe.db.exists("Customer Group", self.name): if frappe.db.exists("Customer Group", self.name):
frappe.throw(_("A Customer Group exists with same name please change the Customer name or rename the Customer Group")) frappe.throw(_("A Customer Group exists with same name please change the Customer name or rename the Customer Group"), frappe.NameError)
def delete_customer_address(self): def delete_customer_address(self):
addresses = frappe.db.sql("""select name, lead from `tabAddress` addresses = frappe.db.sql("""select name, lead from `tabAddress`