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)