Odoo Help


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.


path problem with openerp controller

on 7/1/13, 10:44 AM 1,870 views

I try to do the openerp tutorial doc.openerp.com/trunk/web/web_controllers/

but it fail :/


    import openerp.addons.web.common.http as openerpweb
except ImportError:
    import web.common.http as openerpweb    # noqa

class main(openerpweb.Controller):

    @openerpweb.route('/some_html', type="http")
    def some_html(self):
        return "<h1>This is a test</h1>"

    @openerpweb.route('/some_json', type="json")
    def some_json(self):
        return {"sample_dictionary": "This is a sample JSON dictionary"}

The error:

2013-07-01 12:32:47,017 20491 CRITICAL ? openerp.modules.module: Couldn't load module web 2013-07-01 12:32:47,017 20491 CRITICAL ? openerp.modules.module: 'module' object has no attribute 'route' 2013-07-01 12:32:47,018 20491 ERROR ? openerp: Failed to load server-wide module web.

But the module path is correct and openerp works without this.

openerp path:

./openerp-server --addons=../addons,../web/addons

Thanks in advance for your help ;)

under which version of OpenERP you are working ?

Med Said BARA
on 2/17/14, 11:39 AM
On 9/17/13, 5:30 AM

The http object has no attribute 'route'
_cp_path = '/some_html'

def some_html(self, req):

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

0 follower(s)


Asked: 7/1/13, 10:44 AM
Seen: 1870 times
Last updated: 3/16/15, 8:10 AM