In this article you will learn how to inherit /web/login/ controller in odoo. The purpose of inheriting is you want to add or modify some functionality in existing odoo controller.
Inherit web login controller in odoo
To inherit controllers in odoo follow below steps:
Import original controller class for example if we want to inherit web/login controller than importfrom openerp.addons.web.controllers.main import Home
Create a new class with any name and inherit that class with original class name
class Extension_Home(Home):
In controller rout just pass empty rout for example
@http.route()
Create or override existing controller method with same name as original controller has
def web_login(self, redirect=None, **kw):
Return super method that call original controller method
return super(Extension_Home, self).web_login()
0 Comments