yousef_soliman
yousef_soliman

Reputation: 86

ImportError: No module named http in odoo

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

Upvotes: 1

Views: 2305

Answers (2)

user2327023
user2327023

Reputation: 11

Try the below

import odoo.http as http

Upvotes: 0

yousef_soliman
yousef_soliman

Reputation: 86

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

Upvotes: 1

Related Questions