Merge pull request #5364 from rohitwaghchaure/setup_wizard_access_issue

[Fix] Restrict access to setup wizard page if setup is already completed
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 98a6019..bd7009e 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -20,6 +20,7 @@
 
 	install_fixtures.install(args.get("country"))
 
+	update_setup_wizard_access()
 	create_fiscal_year_and_company(args)
 	create_users(args)
 	set_defaults(args)
@@ -53,6 +54,14 @@
 
 			pass
 
+def update_setup_wizard_access():
+	setup_wizard = frappe.get_doc('Page', 'setup-wizard')
+	for roles in setup_wizard.roles:
+		if roles.role == 'System Manager':
+			roles.role = 'Administrator'
+	setup_wizard.flags.ignore_permissions = 1
+	setup_wizard.save()
+
 def create_fiscal_year_and_company(args):
 	if (args.get('fy_start_date')):
 		curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date'))