on deletion of lead, delete communication
diff --git a/selling/doctype/lead/lead.py b/selling/doctype/lead/lead.py
index c336fe2..571cdfd 100644
--- a/selling/doctype/lead/lead.py
+++ b/selling/doctype/lead/lead.py
@@ -97,7 +97,6 @@
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)