diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9e3708184f..513d82fe0b 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -367,3 +367,4 @@ erpnext.patches.v7_2.delete_fleet_management_module_def erpnext.patches.v7_2.contact_address_links erpnext.patches.v7_2.mark_students_active erpnext.patches.v7_2.set_null_value_to_fields +erpnext.patches.v7_2.update_guardian_name_in_student_master diff --git a/erpnext/patches/v7_2/update_guardian_name_in_student_master.py b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py new file mode 100644 index 0000000000..65c7ef0084 --- /dev/null +++ b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py @@ -0,0 +1,8 @@ +import frappe +from frappe.model.utils.rename_field import rename_field + +def execute(): + student_guardians = frappe.get_all("Student Guardian", fields=["guardian"]) + for student_guardian in student_guardians: + guardian_name = frappe.db.get_value("Guardian", student_guardian.guardian, "guardian_name") + frappe.db.sql("update `tabStudent Guardian` set guardian_name = %s where guardian= %s", (guardian_name, student_guardian.guardian)) \ No newline at end of file diff --git a/erpnext/schools/doctype/student/student.js b/erpnext/schools/doctype/student/student.js index e69de29bb2..10fefae8bd 100644 --- a/erpnext/schools/doctype/student/student.js +++ b/erpnext/schools/doctype/student/student.js @@ -0,0 +1 @@ +cur_frm.add_fetch("guardian", "guardian_name", "guardian_name"); \ No newline at end of file diff --git a/erpnext/schools/doctype/student/student.json b/erpnext/schools/doctype/student/student.json index edaae07971..50efdc1772 100644 --- a/erpnext/schools/doctype/student/student.json +++ b/erpnext/schools/doctype/student/student.json @@ -467,6 +467,63 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_18", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Guardian Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "guardians", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Guardians", + "length": 0, + "no_copy": 0, + "options": "Student Guardian", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -662,63 +719,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "section_break_18", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Guardian Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "guardians", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Guardians", - "length": 0, - "no_copy": 0, - "options": "Student Guardian", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -819,7 +819,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-12-01 12:55:32.453131", + "modified": "2017-01-27 13:19:55.693540", "modified_by": "Administrator", "module": "Schools", "name": "Student", @@ -836,7 +836,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 0, "read": 1, @@ -857,7 +856,6 @@ "export": 1, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -875,5 +873,6 @@ "sort_field": "modified", "sort_order": "DESC", "title_field": "title", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.json b/erpnext/schools/doctype/student_applicant/student_applicant.json index 2c6947c5f9..beb53145f4 100644 --- a/erpnext/schools/doctype/student_applicant/student_applicant.json +++ b/erpnext/schools/doctype/student_applicant/student_applicant.json @@ -988,7 +988,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-11-17 10:26:13.225135", + "modified": "2017-01-27 13:19:56.616331", "modified_by": "Administrator", "module": "Schools", "name": "Student Applicant", @@ -1005,7 +1005,6 @@ "export": 1, "if_owner": 0, "import": 1, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -1023,5 +1022,6 @@ "sort_field": "modified", "sort_order": "DESC", "title_field": "title", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/schools/doctype/student_guardian/student_guardian.json b/erpnext/schools/doctype/student_guardian/student_guardian.json index d8e50c97b2..0a41538347 100644 --- a/erpnext/schools/doctype/student_guardian/student_guardian.json +++ b/erpnext/schools/doctype/student_guardian/student_guardian.json @@ -22,6 +22,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Guardian", "length": 0, "no_copy": 0, @@ -31,6 +32,35 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "guardian_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Guardian Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, "search_index": 0, @@ -49,6 +79,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Relation", "length": 0, "no_copy": 0, @@ -58,6 +89,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -75,7 +107,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-09-01 14:39:03.576590", + "modified": "2017-01-27 13:36:47.177809", "modified_by": "Administrator", "module": "Schools", "name": "Student Guardian", @@ -87,5 +119,6 @@ "read_only_onload": 0, "sort_field": "modified", "sort_order": "DESC", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file