fix: Delete Auto Email Reports (#22010)
This commit is contained in:
parent
fa0b73ce25
commit
354baf0c5e
@ -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])
|
Loading…
Reference in New Issue
Block a user