如何解决这个错误?我在安装模块时遇到此错误

时间:2016-01-27 05:42:29

标签: odoo-9

错误回复

Odoo服务器错误

 Traceback (most recent call last):
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 643, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 680, in dispatch
        result = self._call_function(**self.params)
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 316, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/tiny/Desktop/odoo9/openerp/service/model.py", line 118, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 309, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 959, in __call__
        return self.method(*args, **kw)
      File "/home/tiny/Desktop/odoo9/openerp/http.py", line 509, in response_wrap
        response = f(*args, **kw)
      File "/home/tiny/Desktop/odoo9/openerp/addons/web/controllers/main.py", line 896, in call_button
        action = self._call_kw(model, method, args, {})
      File "/home/tiny/Desktop/odoo9/openerp/addons/web/controllers/main.py", line 884, in _call_kw
        return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
      File "/home/tiny/Desktop/odoo9/openerp/api.py", line 250, in wrapper
        return old_api(self, *args, **kwargs)
      File "/home/tiny/Desktop/odoo9/openerp/addons/base/module/module.py", line 459, in button_immediate_install
        return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
      File "/home/tiny/Desktop/odoo9/openerp/api.py", line 250, in wrapper
        return old_api(self, *args, **kwargs)
      File "/home/tiny/Desktop/odoo9/openerp/addons/base/module/module.py", line 533, in _button_immediate_function
        registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
      File "/home/tiny/Desktop/odoo9/openerp/modules/registry.py", line 385, in new
        openerp.modules.load_modules(registry._db, force_demo, status, update_module)
      File "/home/tiny/Desktop/odoo9/openerp/modules/loading.py", line 338, in load_modules
        loaded_modules, update_module)
      File "/home/tiny/Desktop/odoo9/openerp/modules/loading.py", line 237, in load_marked_modules
        loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
      File "/home/tiny/Desktop/odoo9/openerp/modules/loading.py", line 123, in load_module_graph
        load_openerp_module(package.name)
      File "/home/tiny/Desktop/odoo9/openerp/modules/module.py", line 324, in load_openerp_module
        __import__('openerp.addons.' + module_name)
      File "/home/tiny/Desktop/odoo9/openerp/modules/module.py", line 61, in load_module
        mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
      File "/home/tiny/Desktop/odoo9/addons/openacademy/__init__.py", line 2, in <module>
        from . import controllers
    ImportError: cannot import name controllers

1 个答案:

答案 0 :(得分:0)

只需验证odoo9/addons/openacademy包是否在您的模块中openacademy/__init__.py进行了修改。

如果没有,则在controllers

内进行评论

OR

只需在/odoo9/addons/openacademy/controllers放置__init__.py文件夹,在/odoo9/addons/openacademy/controllers/__init__.py放置State以将其标记为python包。

现在这将解决这个问题。