Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sehrishnaz/29b46fcc37db7663710a324d53eadc8d to your computer and use it in GitHub Desktop.
Save sehrishnaz/29b46fcc37db7663710a324d53eadc8d to your computer and use it in GitHub Desktop.
unbound method web_login() must be called with instance as first argument (got nothing instead),Invoke controller function from another controller in odoo
class InheritedHome(Home):
@http.route()
def web_login(self, redirect=None, **kw):
if 'login' in kw:
#your_logic_goes_here()
return super(Extension_Home, self).web_login()
class MyCustomClass(http.Controller):
@http.route('/test/', type='http', auth='public', website=True)
def custom_method(self, redirect=None, **kw):
if request.httprequest.method == 'POST':
# getting instance of InheritedHome class
inheritHome = InheritedHome()
# calling InheritedHome method web_login using instance of InheritedHome Class
return inheritHome.web_login()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment