Skip to content

Commit

Permalink
fix: Delete Auto Email Reports (#22009)
Browse files Browse the repository at this point in the history
  • Loading branch information
marination committed May 28, 2020
1 parent fd351f8 commit 1a25aa8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion erpnext/patches/v13_0/delete_old_purchase_reports.py
Expand Up @@ -12,4 +12,12 @@ def execute():

for report in reports_to_delete:
if frappe.db.exists("Report", report):
frappe.delete_doc("Report", report)
delete_auto_email_reports(report)

frappe.delete_doc("Report", report)

def delete_auto_email_reports(report):
""" Check for one or multiple Auto Email Reports and delete """
auto_email_reports = frappe.db.get_values("Auto Email Report", {"report": report}, ["name"])
for auto_email_report in auto_email_reports:
frappe.delete_doc("Auto Email Report", auto_email_report[0])

0 comments on commit 1a25aa8

Please sign in to comment.