Merge pull request #33784 from rohitwaghchaure/fixed-setup-complete-issue

fix: setup complete issue
This commit is contained in:
rohitwaghchaure 2025-08-25 18:14:46 +05:30 committed by GitHub
commit 5d675e8aa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,13 @@ class InstalledApplications(Document):
for app in frappe.utils.get_installed_apps_info():
has_setup_wizard = 1
setup_complete = app_wise_setup_details.get(app.get("app_name")) or 0
if app.get("app_name") in ["frappe", "erpnext"] and not setup_complete:
if app.get("app_name") == "frappe" and has_non_admin_user():
setup_complete = 1
if app.get("app_name") == "erpnext" and has_company():
setup_complete = 1
if app.get("app_name") not in ["frappe", "erpnext"]:
setup_complete = 0
has_setup_wizard = 0
@ -73,6 +80,22 @@ class InstalledApplications(Document):
frappe.reload_doc("integrations", "doctype", "webhook")
def has_non_admin_user():
if frappe.db.has_table("User") and frappe.db.get_value(
"User", {"user_type": "System User", "name": ["not in", ["Administrator", "Guest"]]}
):
return True
return False
def has_company():
if frappe.db.has_table("Company") and frappe.get_all("Company", limit=1):
return True
return False
@frappe.whitelist()
def update_installed_apps_order(new_order: list[str] | str):
"""Change the ordering of `installed_apps` global