Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How this http route can stay empty?

By
Pascal Tremblay
on 8/20/15, 8:13 PM 773 views

Hello there,

In the file odoo-8.0-20150819/openerp/addons/auth_signup/controllers/main.py, for example, the http.route() doesn't have argument. No route in the brackets. How could it be possible?

See here :


class AuthSignupHome(openerp.addons.web.controllers.main.Home):

    @http.route()
    def web_login(self, *args, **kw):
        _logger.error("WEB LOGIN AUTHSIGNUPHOME")
        ensure_db()
        response = super(AuthSignupHome, self).web_login(*args, **kw)
        response.qcontext.update(self.get_auth_signup_config())
        if request.httprequest.method == 'GET' and request.session.uid and request.params.get('redirect'):
            # Redirect if already logged in and redirect param is present
            return http.redirect_with_hash(request.params.get('redirect'))
        _logger.error("END WEB LOGIN AUTHSIGNUPHOME")
        return response


If I try to override it in a custom module, I get this error :

....   assert routing['routes'], "Method %r has not route defined" % mv ..........

Could you explain please what is this concept of empty route?

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/20/15, 8:13 PM
Seen: 773 times
Last updated: 8/20/15, 8:13 PM