From d20e36f3fdcddd29070a4380451b0760532070e5 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 27 Feb 2020 19:07:58 +0530 Subject: [PATCH] feat: ignore permission when deleting linked emails (#20751) * feat: ignore permission when deleting linked emails * fix: uncommented important snippet --- erpnext/setup/doctype/company/delete_company_transactions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/company/delete_company_transactions.py b/erpnext/setup/doctype/company/delete_company_transactions.py index 1503adb504..8ecc13b2fb 100644 --- a/erpnext/setup/doctype/company/delete_company_transactions.py +++ b/erpnext/setup/doctype/company/delete_company_transactions.py @@ -108,8 +108,8 @@ def delete_lead_addresses(company_name): def delete_communications(doctype, company_name, company_fieldname): reference_docs = frappe.get_all(doctype, filters={company_fieldname:company_name}) reference_doc_names = [r.name for r in reference_docs] - + communications = frappe.get_all("Communication", filters={"reference_doctype":doctype,"reference_name":["in", reference_doc_names]}) communication_names = [c.name for c in communications] - frappe.delete_doc("Communication", communication_names) + frappe.delete_doc("Communication", communication_names, ignore_permissions=True)