From 2cdc0c3f2d2c3e89759c1c0f75fda2be288c9599 Mon Sep 17 00:00:00 2001 From: aakvatech <35020381+aakvatech@users.noreply.github.com> Date: Fri, 14 Aug 2020 10:26:54 +0300 Subject: [PATCH] fix: AttributeError: 'ProgramFee' object has no attribute 'course' Error occurs while program enrollment on new student. This happens on version 12 and not on version 13. Version 12 uses course_list = [course.course for course in program.get_all_children()] where as version 13 uses course_list = [course.course for course in program.courses] erpnext/erpnext/education/doctype/program_enrollment/program_enrollment.py --- .../education/doctype/program_enrollment/program_enrollment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index d5348ffd067..75361728917 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -71,7 +71,7 @@ class ProgramEnrollment(Document): def create_course_enrollments(self): student = frappe.get_doc("Student", self.student) program = frappe.get_doc("Program", self.program) - course_list = [course.course for course in program.get_all_children()] + course_list = [course.course for course in program.courses] for course_name in course_list: student.enroll_in_course(course_name=course_name, program_enrollment=self.name)