Skip to content

Commit

Permalink
refactor: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillarAnand committed Feb 2, 2022
1 parent 16ca81d commit b447cdc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 52 deletions.
16 changes: 16 additions & 0 deletions erpnext/patches/v14_0/delete_non_profit_doctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ def execute():

frappe.delete_doc("Workspace", "Non Profit", ignore_missing=True, force=True)

print_formats = frappe.get_all("Print Format", {"module": "Non Profit", "standard": "Yes"}, pluck='name')
for print_format in print_formats:
frappe.delete_doc("Print Format", print_format, ignore_missing=True, force=True)

print_formats = ['80G Certificate for Membership', '80G Certificate for Donation']
for print_format in print_formats:
frappe.delete_doc("Print Format", print_format, ignore_missing=True, force=True)

reports = frappe.get_all("Report", {"module": "Non Profit", "is_standard": "Yes"}, pluck='name')
for report in reports:
frappe.delete_doc("Report", report, ignore_missing=True, force=True)
Expand All @@ -17,3 +25,11 @@ def execute():
doctypes = frappe.get_all("DocType", {"module": "Non Profit", "custom": 0}, pluck='name')
for doctype in doctypes:
frappe.delete_doc("DocType", doctype, ignore_missing=True)

custom_fields = [
{"dt": "Member", "fieldname": "pan_number"},
{"dt": "Donor", "fieldname": "pan_number"},
]
for field in custom_fields:
custom_field = frappe.db.get_value("Custom Field", field)
frappe.delete_doc("Custom Field", custom_field, ignore_missing=True)

This file was deleted.

Empty file.

This file was deleted.

Empty file.

0 comments on commit b447cdc

Please sign in to comment.