Last active
August 11, 2020 12:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Read more in detail: https://learnopenerp.blogspot.com/2020/08/unbound-method-call-controller-function-from-another-controller-odoo.html