我在Windows 7上使用Odoo 8,事情一切正常,直到我试图让 fleet.vehicle 类继承另一个类(通过原型设计继承):
_name = 'fleet.vehicle'
_inherit = 'another.class'
从那时起,我在尝试访问http://localhost:8069/web时遇到此错误:
内部服务器错误
服务器遇到内部错误但无法完成 你的申请。服务器过载或出现错误 申请。
这是 openerp-server.log 的支持:
2016-03-14 13:59:31,033 1904 INFO Odoo8_DB openerp.modules.loading: loading 1 modules...
2016-03-14 13:59:31,058 1904 INFO Odoo8_DB openerp.modules.loading: 1 modules loaded in 0.02s, 0 queries
2016-03-14 13:59:31,239 1904 INFO Odoo8_DB openerp.modules.loading: loading 53 modules...
2016-03-14 13:59:31,266 1904 CRITICAL Odoo8_DB openerp.modules.module: Couldn't load module fleet
2016-03-14 13:59:31,267 1904 CRITICAL Odoo8_DB openerp.modules.module: unindent does not match any outer indentation level (fleet.py, line 313)
2016-03-14 13:59:31,279 1904 INFO Odoo8_DB werkzeug: 127.0.0.1 - - [14/Mar/2016 13:59:31] "GET /favicon.ico HTTP/1.1" 500 -
2016-03-14 13:59:31,293 1904 ERROR Odoo8_DB werkzeug: Error on request:
Traceback (most recent call last):
File "werkzeug\serving.py", line 177, in run_wsgi
File "werkzeug\serving.py", line 165, in execute
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\service\server.py", line 290, in app
return self.app(e, s)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\service\wsgi_server.py", line 216, in application
return application_unproxied(environ, start_response)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\service\wsgi_server.py", line 202, in application_unproxied
result = handler(environ, start_response)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\http.py", line 1290, in __call__
return self.dispatch(environ, start_response)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\http.py", line 1428, in dispatch
ir_http = request.registry['ir.http']
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\http.py", line 346, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\registry.py", line 339, in get
update_module)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\loading.py", line 351, in load_modules
force, status, report, loaded_modules, update_module)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\loading.py", line 255, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\loading.py", line 143, in load_module_graph
load_openerp_module(package.name)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\module.py", line 315, in load_openerp_module
__import__('openerp.addons.' + module_name)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\modules\module.py", line 80, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\addons\fleet\__init__.py", line 21, in <module>
import fleet
File "D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\addons\fleet\fleet.py", line 313
LogFuel = self.pool['fleet.vehicle.log.fuel']
^
IndentationError: unindent does not match any outer indentation level
即使在删除我添加的行后,我仍然收到同样的错误, 我试图重新启动odoo-server,postgreSQL-server并刷新数据库但是徒劳无功.. 我会很感激任何帮助
答案 0 :(得分:2)
与python有关:你有一些尾随(前或后)缩进。 在IDE中打开文件,并显示缩进。在python中,每个块应该在同一个缩进级别。
编辑:正如筹码所说,它可能在附近:D:\MesDocuments\Les_prog\Odoo 8.0-20160118\server\openerp\addons\fleet\fleet.py", line 313