mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 20:18:27 +00:00
feat: ignore permission when deleting linked emails (#20753)
This commit is contained in:
@@ -106,11 +106,11 @@ def delete_lead_addresses(company_name):
|
||||
frappe.db.sql("""update tabCustomer set lead_name=NULL where lead_name in ({leads})""".format(leads=",".join(leads)))
|
||||
|
||||
def delete_communications(doctype, company_name, company_fieldname):
|
||||
|
||||
|
||||
refrence_docs = frappe.get_all(doctype, filters={company_fieldname:company_name})
|
||||
reference_doctype_names = [r.name for r in refrence_docs]
|
||||
|
||||
communications = frappe.get_all("Communication", filters={"reference_doctype":doctype,"reference_name":["in",reference_doctype_names]})
|
||||
communication_names = [c.name for c in communications]
|
||||
|
||||
frappe.delete_doc("Communication",communication_names)
|
||||
frappe.delete_doc("Communication", communication_names, ignore_permissions=True)
|
||||
|
||||
Reference in New Issue
Block a user