[Fix] Delete communications when user deletes company transactions
This commit is contained in:
parent
44e9195378
commit
54d8590064
@ -64,6 +64,16 @@ def delete_for_doctype(doctype, company_name):
|
||||
frappe.db.sql("""update tabSeries set current = %s
|
||||
where name=%s""", (last, prefix))
|
||||
|
||||
# delete communication
|
||||
try:
|
||||
frappe.db.sql("""
|
||||
select name, reference_doctype from `tabCommunication`
|
||||
where reference_doctype = "{0}" and
|
||||
exists(select name from `tab{1}` where company = %s and
|
||||
`tabCommunication`.reference_name = name)
|
||||
""".format(doctype, doctype), company_name)
|
||||
except Exception, e:
|
||||
print e
|
||||
|
||||
def delete_bins(company_name):
|
||||
frappe.db.sql("""delete from tabBin where warehouse in
|
||||
|
Loading…
Reference in New Issue
Block a user