ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

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


#1

Greetings all,

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

regards,

Parth


#2

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


#3

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


Permission By Field
Access Control - Premissions
If_owner and apply user permission working together again
#4

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


#5

So how did you go about ?