From 77a2ee01e27223b4b6f20aee53b5d9f3b68bb628 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 28 May 2013 11:56:48 +0530 Subject: [PATCH] [rename][fixes] do not update customer name of renaming of customer --- selling/doctype/customer/customer.py | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/selling/doctype/customer/customer.py b/selling/doctype/customer/customer.py index 6f54ef9641..72e12b7942 100644 --- a/selling/doctype/customer/customer.py +++ b/selling/doctype/customer/customer.py @@ -219,27 +219,8 @@ class DocType(TransactionBase): def on_rename(self, new, old, merge=False): #update customer_name if not naming series if webnotes.defaults.get_global_default('cust_master_name') == 'Customer Name': - update_fields = [ - ('Customer', 'name'), - ('Address', 'customer'), - ('Contact', 'customer'), - ('Customer Issue', 'customer'), - ('Delivery Note', 'customer'), - ('Opportunity', 'customer'), - ('Installation Note', 'customer'), - ('Maintenance Schedule', 'customer'), - ('Maintenance Visit', 'customer'), - ('Project', 'customer'), - ('Quotation', 'customer'), - ('Sales Invoice', 'customer'), - ('Sales Order', 'customer'), - ('Serial No', 'customer'), - ('Shipping Address', 'customer'), - ('Stock Entry', 'customer'), - ('Support Ticket', 'customer')] - for rec in update_fields: - sql("""update `tab%s` set customer_name = %s - where `%s` = %s""" % (rec[0], "%s" ,rec[1], "%s"), (new, old)) + webnotes.conn.sql("""update `tabCustomer` set customer_name = %s where name = %s""", + (new, old)) for account in webnotes.conn.sql("""select name, account_name from tabAccount where master_name=%s and master_type='Customer'""", old, as_dict=1):