fix(patch): ignore links while deleting hr payroll doctypes (#31674)

This commit is contained in:
Rucha Mahabal 2022-07-22 12:46:59 +05:30 committed by GitHub
parent 6883fc95ae
commit 7b0e5661c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,22 +31,22 @@ def execute():
"Professional Tax Deductions",
"Provident Fund Deductions",
]:
frappe.delete_doc("Report", report, ignore_missing=True)
frappe.delete_doc("Report", report, ignore_missing=True, force=True)
doctypes = frappe.get_all(
"DocType", {"module": ("in", ["HR", "Payroll"]), "custom": 0}, pluck="name"
)
for doctype in doctypes:
frappe.delete_doc("DocType", doctype, ignore_missing=True)
frappe.delete_doc("DocType", doctype, ignore_missing=True, force=True)
frappe.delete_doc("DocType", "Salary Slip Loan", ignore_missing=True)
frappe.delete_doc("DocType", "Salary Component Account", ignore_missing=True)
frappe.delete_doc("DocType", "Salary Slip Loan", ignore_missing=True, force=True)
frappe.delete_doc("DocType", "Salary Component Account", ignore_missing=True, force=True)
notifications = frappe.get_all(
"Notification", {"module": ("in", ["HR", "Payroll"]), "is_standard": 1}, pluck="name"
)
for notifcation in notifications:
frappe.delete_doc("Notification", notifcation, ignore_missing=True)
frappe.delete_doc("Notification", notifcation, ignore_missing=True, force=True)
frappe.delete_doc("User Type", "Employee Self Service", ignore_missing=True, force=True)