refactor install.py after_install scripts

This commit is contained in:
meichthys 2026-01-12 02:00:00 +00:00
parent cd37ee9f57
commit a109a0a912

View File

@ -4,13 +4,15 @@ 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."
)
raise FileNotFoundError("ERPNext must be installed before installing this app.")
def after_install():
# Remove non-biblical Genders
adjust_gender_options()
def adjust_gender_options():
"""Remove non-biblical Genders from default gender list"""
genders = frappe.db.get_all("Gender")
for gender in genders:
if gender.name not in ["Male", "Female", "Unknown"]: