Added patch

This commit is contained in:
Neil Trini Lasrado 2016-09-06 15:28:13 +05:30
parent c20adb532f
commit 49da25dd57
2 changed files with 14 additions and 0 deletions

View File

@ -322,3 +322,4 @@ erpnext.patches.v7_0.repost_gle_for_pos_sales_return
erpnext.patches.v7_0.update_missing_employee_in_timesheet
erpnext.patches.v7_0.update_status_for_timesheet
erpnext.patches.v7_0.set_party_name_in_payment_entry
erpnext.patches.v7_1.set_student_guardian

View File

@ -0,0 +1,13 @@
import frappe
def execute():
if frappe.db.exists("DocType", "Guardian"):
frappe.reload_doc("schools", "doctype", "student")
frappe.reload_doc("schools", "doctype", "student_guardian")
guardian = frappe.get_list("Guardian", fields=["name", "student"])
for d in guardian:
if d.student:
student = frappe.get_doc("Student", d.student)
if student:
student.append("guardians", {"guardian": d.name})
student.save()