Skip to Content
Menu
This question has been flagged
1 Reply
3591 Views

How we can override the login method of odoo

Avatar
Discard
Best Answer

Hi,


See this:

from odoo.addons.web.controllers import main


class Home(main.Home):

@http.route('/web/login', type='http', auth="public")
def web_login(self, redirect=None, **kw):
main.ensure_db()
request.params['login_success'] = False
if
request.httprequest.method == 'GET' and redirect and request.session.uid:
return http.redirect_with_hash(redirect)



You can find the code in this module: https://apps.odoo.com/apps/modules/13.0/access_restriction_by_ip/

Thanks
Avatar
Discard