From 6d2d0f9d08a52d7f16a57f0621782127a0cc9d03 Mon Sep 17 00:00:00 2001 From: vidhya Date: Fri, 2 Oct 2026 18:39:00 +0530 Subject: [PATCH] student demo dashboard changed to the frontend portal dashboard --- addons/education_portal/controllers/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/education_portal/controllers/main.py b/addons/education_portal/controllers/main.py index 1504289..16b0296 100644 --- a/addons/education_portal/controllers/main.py +++ b/addons/education_portal/controllers/main.py @@ -281,3 +281,20 @@ class StudentPortalController(CustomerPortal): 'page_name': 'student_announcement_details', } return request.render("education_portal.portal_student_announcement_details", values) + +from odoo.addons.web.controllers.home import Home + +class StudentLoginRedirect(Home): + + def _login_redirect(self, uid, redirect=None): + redirect_url = super()._login_redirect(uid, redirect=redirect) + + # Check if the logged-in user is a student + user = request.env['res.users'].sudo().browse(uid) + + # If the user is a student and there is no specific redirect requested + # (or the redirect is just the default website home / or /my) + if user.student_id and (not redirect or redirect in ['/', '/my']): + return '/my/education/dashboard' + + return redirect_url