我需要一些帮助,请,我试图运行odoo 16从源代码使用Linux的薄荷机器.不幸的是,当我开始调试,我得到了这些错误:
2023-10-28 20:27:49,018 191168 ERROR odoo16 odoo.tools.convert.init: Could not eval(False) for active in {}
2023-10-28 20:27:49,042 191168 ERROR odoo16 odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
ERROR: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
字符串
注意:数据库已创建,但没有表!
我做了这些步骤:
1.安装Python 12
1.我安装了PostgreSQL数据库+PgAdmin 4(都正常)
1.我创建了一个新用户:odoo 16,具有超级用户权限。
1.我从github下载了odoo-16.0
1.我将requirement.txt中的所有依赖下载到虚拟环境中。我的工作文件夹结构:x1c 0d1x我的配置文件:
[options]
db_host = localhost
db_port = 5432
db_user = odoo16
db_password = odoo16
addons_path = /media/smichi/Data2/Odoo16.0/odoo-16.0/addons
default_productivity_apps = True
http_port = 8069
server_wide_modules = web
型
我的VSCode配置:launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "odoo16-start",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/odoo-16.0/odoo-bin",
"console": "integratedTerminal",
"args": [
"--config=${workspaceRoot}/conf/odoo16.conf",
"--database=odoo16",
"-i",
"base"
// Use this to exit the external terminal
//"&&", "exit",
],
"cwd": "${workspaceRoot}"
},
{
"name": "Odoo16-Upgrade",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"program": "${workspaceRoot}/odoo-16.0/odoo-bin",
"args": [
"-c", "${workspaceRoot}/conf/odoo16.conf",
"-u", "my_module_01",
"-d", "oc12_local_02",
// Use this to exit the external terminal
//"&&", "exit"
],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
},
]
}
型
和setting.json:
{
"python.defaultInterpreterPath":"/media/smichi/Data2/Odoo16.0/virtual-env/bin/python3.12",
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.extend([\"\"/home/smichi/.vscode/extensions/ms-python.devicesimulatorexpress-2020.0.36321/out\"\",\"\"/home/smichi/.vscode/extensions/ms-python.devicesimulatorexpress-2020.0.36321/out/micropython\"\",\"\"/home/smichi/.vscode/extensions/ms-python.devicesimulatorexpress-2020.0.36321/out/clue\"\",\"\"/home/smichi/.vscode/extensions/ms-python.devicesimulatorexpress-2020.0.36321/out/base_circuitpython\"\"])"
]
}
型
整个输出:
(virtual-env) smichi@smichi-HP:/media/smichi/Data2/Odoo16.0$ cd /media/smichi/Data2/Odoo16.0 ; /usr/bin/env /media/smichi/Data2/Odoo16.0/virtual-env/bin/python3.12 /home/smichi/.vscode/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 60825 -- /media/smichi/Data2/Odoo16.0/odoo-16.0/odoo-bin --config=/media/smichi/Data2/Odoo16.0/conf/odoo16.conf --database=odoo16 -i base
2023-10-28 20:27:31,182 191168 INFO ? odoo: Odoo version 16.0
2023-10-28 20:27:31,183 191168 INFO ? odoo: Using configuration file at /media/smichi/Data2/Odoo16.0/conf/odoo16.conf
2023-10-28 20:27:31,183 191168 INFO ? odoo: addons paths: ['/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/addons', '/home/smichi/.local/share/Odoo/addons/16.0', '/media/smichi/Data2/Odoo16.0/odoo-16.0/addons']
2023-10-28 20:27:31,184 191168 INFO ? odoo: database: odoo16@localhost:5432
2023-10-28 20:27:32,230 191168 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
2023-10-28 20:27:32,675 191168 INFO ? odoo.service.server: HTTP service (werkzeug) running on smichi-HP:8069
2023-10-28 20:27:32,687 191168 INFO ? odoo.modules.loading: init db
2023-10-28 20:27:34,973 191168 INFO odoo16 odoo.modules.loading: loading 1 modules...
2023-10-28 20:27:34,974 191168 INFO odoo16 odoo.modules.loading: Loading module base (1/1)
2023-10-28 20:27:35,070 191168 INFO odoo16 odoo.modules.registry: module base: creating or updating database tables
2023-10-28 20:27:39,080 191168 INFO odoo16 odoo.models: Prepare computation of ir.module.module.menus_by_module
2023-10-28 20:27:39,081 191168 INFO odoo16 odoo.models: Prepare computation of ir.module.module.reports_by_module
2023-10-28 20:27:39,081 191168 INFO odoo16 odoo.models: Prepare computation of ir.module.module.views_by_module
2023-10-28 20:27:40,830 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.user_id
2023-10-28 20:27:40,830 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.commercial_partner_id
2023-10-28 20:27:40,831 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.display_name
2023-10-28 20:27:40,831 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.company_registry
2023-10-28 20:27:40,832 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.commercial_company_name
2023-10-28 20:27:40,832 191168 INFO odoo16 odoo.models: Prepare computation of res.partner.partner_share
2023-10-28 20:27:41,344 191168 INFO odoo16 odoo.models: Prepare computation of res.currency.decimal_places
2023-10-28 20:27:41,629 191168 INFO odoo16 odoo.models: Prepare computation of res.company.logo_web
2023-10-28 20:27:42,007 191168 INFO odoo16 odoo.models: Prepare computation of res.users.signature
2023-10-28 20:27:42,009 191168 INFO odoo16 odoo.models: Prepare computation of res.users.share
2023-10-28 20:27:49,015 191168 INFO odoo16 odoo.modules.loading: loading base/data/res_bank.xml
2023-10-28 20:27:49,018 191168 ERROR odoo16 odoo.tools.convert.init: Could not eval(False) for active in {}
2023-10-28 20:27:49,042 191168 ERROR odoo16 odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
ERROR: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
^
2023-10-28 20:27:49,043 191168 ERROR odoo16 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 698, in _tag_root
f(rec)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 573, in _tag_record
f_val = _eval_xml(self, field, env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 117, in _eval_xml
return safe_eval(a_eval, idref2)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 39, in <lambda>
safe_eval = lambda expr, ctx={}: s_eval(expr, ctx, nocopy=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 360, in safe_eval
c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 218, in test_expr
assert_valid_codeobj(allowed_codes, code_obj, expr)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 191, in assert_valid_codeobj
raise ValueError("forbidden opcode(s) in %r: %s" % (expr, ', '.join(opname[x] for x in (code_codes - allowed_codes))))
ValueError: forbidden opcode(s) in 'False': RETURN_CONST
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/registry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 429, in load_modules
loaded_modules, processed_modules = load_module_graph(
^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 231, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 71, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 763, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 829, in convert_xml_import
obj.parse(doc.getroot())
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 749, in parse
self._tag_root(de)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 698, in _tag_root
f(rec)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 711, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/addons/base/data/res_bank.xml:5, somewhere inside
<record id="res_bank_1" model="res.bank">
<field name="name">Reserve</field>
<field name="active" eval="False"/>
</record>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/registry.py", line 92, in new
odoo.modules.reset_modules_state(db_name)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 635, in reset_modules_state
cr.execute(
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedTable: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
^
2023-10-28 20:27:49,052 191168 CRITICAL odoo16 odoo.service.server: Failed to initialize database `odoo16`.
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 698, in _tag_root
f(rec)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 573, in _tag_record
f_val = _eval_xml(self, field, env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 117, in _eval_xml
return safe_eval(a_eval, idref2)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 39, in <lambda>
safe_eval = lambda expr, ctx={}: s_eval(expr, ctx, nocopy=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 360, in safe_eval
c = test_expr(expr, _SAFE_OPCODES, mode=mode, filename=filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 218, in test_expr
assert_valid_codeobj(allowed_codes, code_obj, expr)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/safe_eval.py", line 191, in assert_valid_codeobj
raise ValueError("forbidden opcode(s) in %r: %s" % (expr, ', '.join(opname[x] for x in (code_codes - allowed_codes))))
ValueError: forbidden opcode(s) in 'False': RETURN_CONST
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/registry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 429, in load_modules
loaded_modules, processed_modules = load_module_graph(
^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 231, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 71, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 763, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 829, in convert_xml_import
obj.parse(doc.getroot())
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 749, in parse
self._tag_root(de)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 698, in _tag_root
f(rec)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/convert.py", line 711, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/addons/base/data/res_bank.xml:5, somewhere inside
<record id="res_bank_1" model="res.bank">
<field name="name">Reserve</field>
<field name="active" eval="False"/>
</record>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/service/server.py", line 1299, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<decorator-gen-16>", line 2, in new
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/registry.py", line 92, in new
odoo.modules.reset_modules_state(db_name)
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/modules/loading.py", line 635, in reset_modules_state
cr.execute(
File "/media/smichi/Data2/Odoo16.0/odoo-16.0/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedTable: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
型
感谢您的帮助,谢谢
1条答案
按热度按时间c7rzv4ha1#
Odoo在尝试计算
False
表达式时会引发禁止操作码错误,因为Python 12
中新添加了操作码:RETURN_CONST要解决此问题,请降级Python版本