Create install.py

This commit is contained in:
MeIchthys 2025-09-22 23:05:43 -04:00 committed by GitHub
parent 0c5d4795dc
commit c2c92dbb53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

17
church/install.py Normal file
View File

@ -0,0 +1,17 @@
import frappe
def before_install():
# Ensure ERPNext is installed
if "erpnext" not in frappe.get_installed_apps():
raise FileNotFoundError(
f"ERPNext must be installed before installing this app."
)
def after_install():
# Remove non-biblical Genders
genders = frappe.db.get_all("Gender")
for gender in genders:
if gender.name not in ["Male", "Female", "Unknown"]:
frappe.delete_doc("Gender", gender.name, force=True)