student demo dashboard changed to the frontend portal dashboard
This commit is contained in:
parent
5b5fc5c955
commit
6d2d0f9d08
@ -281,3 +281,20 @@ class StudentPortalController(CustomerPortal):
|
|||||||
'page_name': 'student_announcement_details',
|
'page_name': 'student_announcement_details',
|
||||||
}
|
}
|
||||||
return request.render("education_portal.portal_student_announcement_details", values)
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user