when login to the erpnext I want to direclty enter http://0.0.0.0:8000/desk#modules/Accounts. How is it possible
Not out of box, you will need to set the desktop:home_page
default property to change the home page
Here’s a quick and dirty solution:
You can override the redirection after login in by changing the var login_handlers function in
/home/frappe/frappe-bench/apps/frappe/frappe/templates/includes/login
Here, I am redirecting to the calendar view in appointments:
Keep in mind that this is for testing purposes only…You should integrate this functionality via the hooks method because you won’t be able to update erpnext if you change this file.
I have no idea…I ended up using localstorage to set the last_visited variable to whatever i wanted the redirection to be and then i threw an if statement on the login.js file (just because i didnt want the other sites i have on the same server to redirect to that).
I did this on
/home/frappe/frappe-bench/apps/frappe/frappe/templates/includes/login
And i did this on the web.js file i’m using to customize my app (this runs on a separate app)
frappe.ready(function() {
localStorage.last_visited = "/desk#List/Patient Appointment/Calendar";
console.log("last visited: ",localStorage.last_visited);
});
If this was hookable it would have been really nice, it is a feature that many want
…or maybe a setting in the user profile to define the “page after login”? I guess this would depend on the user…
It actually is…Theres the native “on_session_creation” hook you can use…The steps are outlined here
Let me know if you need a more detailed tutorial.
This has been sufficiently dealt with by hooks boot session modification…
Simply create the page you wish to redirect to then edit your boot session home page to redirect to it for a given user/role via a method.