diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 316abe9fe27..17b7993eff7 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -64,9 +64,6 @@ setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages" setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_demo" setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test" -before_install = [ - "erpnext.setup.install.check_setup_wizard_not_completed", -] after_install = "erpnext.setup.install.after_install" boot_session = "erpnext.startup.boot.boot_session" diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js index f0ec48479c7..4b29ef38d76 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -8,6 +8,13 @@ frappe.pages["setup-wizard"].on_page_load = function (wrapper) { }; frappe.setup.on("before_load", function () { + if ( + frappe.boot.setup_wizard_completed_apps?.length && + frappe.boot.setup_wizard_completed_apps.includes("erpnext") + ) { + return; + } + erpnext.setup.slides_settings.map(frappe.setup.add_slide); }); @@ -91,7 +98,7 @@ erpnext.setup.slides_settings = [ }, set_fy_dates: function (slide) { - var country = frappe.wizard.values.country; + var country = frappe.wizard.values.country || frappe.defaults.get_default("country"); if (country) { let fy = erpnext.setup.fiscal_years[country]; @@ -113,7 +120,7 @@ erpnext.setup.slides_settings = [ }, load_chart_of_accounts: function (slide) { - let country = frappe.wizard.values.country; + let country = frappe.wizard.values.country || frappe.defaults.get_default("country"); if (country) { frappe.call({ diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 09e163decd0..a0828856253 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -35,13 +35,6 @@ def after_install(): frappe.db.commit() -def check_setup_wizard_not_completed(): - if cint(frappe.db.get_single_value("System Settings", "setup_complete") or 0): - message = """ERPNext can only be installed on a fresh site where the setup wizard is not completed. -You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall""" - frappe.throw(message) # nosemgrep - - def make_default_operations(): for operation in ["Assembly"]: if not frappe.db.exists("Operation", operation): diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 1a70c6b0687..e3d6d1f2353 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -4,6 +4,7 @@ import frappe from frappe import _ +from frappe.core.doctype.installed_applications.installed_applications import get_setup_wizard_completed_apps import erpnext @@ -45,7 +46,7 @@ def get_level(): activation_level += 1 sales_data.append({doctype: count}) - if frappe.db.get_single_value("System Settings", "setup_complete"): + if "erpnext" in get_setup_wizard_completed_apps(): activation_level += 1 communication_number = frappe.db.count("Communication", dict(communication_medium="Email"))