From 476019a930a29b4e966e8ec55da8b40fc9633671 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 19 May 2015 13:02:23 +0530 Subject: [PATCH] [fix] throw name error for duplicate group --- erpnext/selling/doctype/customer/customer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 19a9aae84d..f82e2fbeeb 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -76,7 +76,7 @@ class Customer(TransactionBase): def validate_name_with_customer_group(self): 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): addresses = frappe.db.sql("""select name, lead from `tabAddress` @@ -125,9 +125,9 @@ def get_dashboard_info(customer): billing_this_year = frappe.db.sql("""select sum(base_grand_total) from `tabSales Invoice` - where customer=%s and docstatus = 1 and fiscal_year = %s""", + where customer=%s and docstatus = 1 and fiscal_year = %s""", (customer, frappe.db.get_default("fiscal_year"))) - + total_unpaid = frappe.db.sql("""select sum(outstanding_amount) from `tabSales Invoice` where customer=%s and docstatus = 1""", customer)