fix: Add a setting to make creation of new Student User optional (#19122)

* New setting to skip Student User creation

* Allow skip of new User creation via settings
diff --git a/erpnext/education/doctype/education_settings/education_settings.json b/erpnext/education/doctype/education_settings/education_settings.json
index 32b5fb8..967a030 100644
--- a/erpnext/education/doctype/education_settings/education_settings.json
+++ b/erpnext/education/doctype/education_settings/education_settings.json
@@ -11,6 +11,7 @@
   "validate_batch",
   "validate_course",
   "academic_term_reqd",
+  "user_creation_skip",
   "section_break_7",
   "instructor_created_by",
   "web_academy_settings_section",
@@ -91,6 +92,13 @@
    "fieldname": "enable_lms",
    "fieldtype": "Check",
    "label": "Enable LMS"
+  },
+  {
+   "default": "0",
+   "description": "By default, a new User is created for every new Student. If enabled, no new User will be created when a new Student is created.",
+   "fieldname": "user_creation_skip",
+   "fieldtype": "Check",
+   "label": "Skip User creation for new Student"
   }
  ],
  "issingle": 1,
@@ -133,4 +141,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py
index 705c6e4..9af5e22 100644
--- a/erpnext/education/doctype/student/student.py
+++ b/erpnext/education/doctype/student/student.py
@@ -40,7 +40,8 @@
 			frappe.throw(_("Student {0} exist against student applicant {1}").format(student[0][0], self.student_applicant))
 
 	def after_insert(self):
-		self.create_student_user()
+		if not frappe.get_single('Education Settings').user_creation_skip:
+			self.create_student_user()
 
 	def create_student_user(self):
 		"""Create a website user for student creation if not already exists"""