Skip to content

Commit

Permalink
feat: remove custom records on uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Jul 14, 2023
1 parent 140e9d0 commit cbff07e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions erpnext_germany/uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
def before_uninstall():
remove_custom_fields()
remove_property_setters()
remove_custom_records()


def remove_custom_fields():
Expand Down Expand Up @@ -35,3 +36,10 @@ def remove_property_setters():
"value": ps[-2]
}
)


def remove_custom_records():
print("* removing custom records...")
for record in frappe.get_hooks("germany_custom_records"):
doctype = record.pop("doctype")
frappe.db.delete(doctype, record)

0 comments on commit cbff07e

Please sign in to comment.