From 34e13add4c6bb567063d0cc9b6ec5ccece5704e7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Mar 2013 11:14:25 +0530 Subject: [PATCH] on deletion of lead, delete communication --- selling/doctype/lead/lead.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/selling/doctype/lead/lead.py b/selling/doctype/lead/lead.py index c336fe2132..571cdfd516 100644 --- a/selling/doctype/lead/lead.py +++ b/selling/doctype/lead/lead.py @@ -97,7 +97,6 @@ class DocType(SellingController): return webnotes.conn.get_value('Sales Email Settings',None,'email_id') def on_trash(self): - webnotes.conn.sql("""delete from tabCommunication where lead=%s""", - self.doc.name) + webnotes.conn.sql("""update tabCommunication set lead=null where lead=%s""", self.doc.name) webnotes.conn.sql("""update `tabSupport Ticket` set lead='' where lead=%s""", self.doc.name)