Skip to Content
Menu
This question has been flagged
1 Reply
7249 Views

error in odoo 10 when i try to write basic controller for web


    from odoo import http


show error


    2017-07-09 13:20:10,128 9183 ERROR ? werkzeug: Error on request:

    Traceback (most recent call last):

      File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi

        execute(self.server.app)

      File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute

        application_iter = app(environ, start_response)

      File "/odoo/odoo-server/odoo/service/server.py", line 250, in app

        return self.app(e, s)

      File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 184, in application

        return application_unproxied(environ, start_response)

      File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 170, in application_unproxied

        result = handler(environ, start_response)

      File "/odoo/odoo-server/odoo/http.py", line 1307, in __call__

        self.load_addons()

      File "/odoo/odoo-server/odoo/http.py", line 1328, in load_addons

        m = __import__('odoo.addons.' + module)

      File "/odoo/odoo-server/odoo/modules/module.py", line 81, in load_module

        execfile(modfile, new_mod.__dict__)

      File "/odoo/odoo-server/addons/web_printscreen_zb/__init__.py", line 25, in <module>

        import controllers

      File "/odoo/odoo-server/addons/web_printscreen_zb/controllers.py", line 28, in <module>

        import openerp.addons.web.http as openerpweb

      File "/odoo/odoo-server/odoo/modules/module.py", line 109, in load_module

        mod = importlib.import_module(canonical)

      File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module

        __import__(name)

    ImportError: No module named http



i read the documentation of odoo to write web controller but same result.


and i have tried to 


from odoo.addons.web import http


same result

Avatar
Discard
Author Best Answer

the problem has been solved by move the code from controller.py to another file file.py i don't know why this ..!

Avatar
Discard
Related Posts Replies Views Activity
3
Jul 20
7594
2
Jun 18
8132
1
Oct 17
7063
0
Oct 22
1615
2
Jan 18
2344