Merge pull request #33784 from rohitwaghchaure/fixed-setup-complete-issue
fix: setup complete issue
This commit is contained in:
commit
5d675e8aa7
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue