Try ERPNext Buy Support Partners Foundation Foundation Members

Can we create a Login for Students where they can see their Enrolled Courses and Fees

Greetings all,

Can we create a Login for Students where they can see their Enrolled Courses and Fees?

regards,

Parth

s…give read only access to the program enrollment doctype for the students

Thanks for the reponse.

I already tried that but my problem was student should be able to see only their enrolled courses and no one else.

I later figured out you can put a hooks on list view for loading docs only for current student by applying permission_query_conditions on hooks.py on my custom app.

permission_query_conditions = {
    "Program Enrollment": "my_app_path.query_condition_for_enrollment",
}

and wrote some logic to pull the program enrollment for current logged in student only:

def query_condition_for_enrollment(arg):
    loaded_students = frappe.get_all ("Student", filters={"student_email_id":frappe.session.user},fields=["name"])
    ## check if user is there:
    if len(loaded_students) > 0 :
        print (loaded_students[0].name)
        return "(`tabProgram Enrollment`.student='{user}' )".format(user=loaded_students[0].name)
    else :
        return None

Hope it helps others as well.

Regards,

Parth

1 Like

:+1:i also had a similar thing done…but v then reverted back as our requirements did not mandate that…

So how did you go about ?