我一直在尝试为Odoo创建一个新的数据库,我现在做了几件事。
约翰@约翰膝上型:
$ createdb test
$ cd ~/pycharm_projects
$ mkdir test
$ cd ./test
$ git clone https://github.com/odoo/odoo.git -b 8.0
$ cd ./odoo
$ ./odoo.py -d test
(这直接来自Odoo Development Essentials一书。)
这是我在终端上得到的:
2015-08-12 06:31:15,752 5204 INFO ? openerp: OpenERP version 8.0
2015-08-12 06:31:15,754 5204 INFO ? openerp: addons paths: ['/home/johan/.local/share/Odoo/addons/8.0', u'/home/johan/pycharm_projects/odoo_dev/custom_addons', u'/home/johan/pycharm_projects/odoo_dev/odoo/addons', '/home/johan/pycharm_projects/test/odoo/openerp/addons']
2015-08-12 06:31:15,754 5204 INFO ? openerp: database hostname: localhost
2015-08-12 06:31:15,754 5204 INFO ? openerp: database port: 5432
2015-08-12 06:31:15,754 5204 INFO ? openerp: database user: johan
2015-08-12 06:31:16,671 5204 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-08-12 06:31:16,709 5204 INFO ? openerp.modules.loading: init db
2015-08-12 06:31:20,619 5204 ERROR ? openerp.sql_db: bad query: INSERT INTO ir_module_category (name, parent_id) VALUES ('I have to look for thiscategory is the functional category of the module, which defaults toUncategoryzed. This list of existing categories can be found in the securityGroups form (settings | user | groups menu), in the Application fielddrop-down list.', NULL) RETURNING id
Traceback (most recent call last):
File "/home/johan/pycharm_projects/test/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
DataError: value too long for type character varying(128)
2015-08-12 06:31:20,649 5204 CRITICAL ? openerp.service.server: Failed to initialize database `test`.
Traceback (most recent call last):
File "/home/johan/pycharm_projects/test/odoo/openerp/service/server.py", line 929, in preload_registries
registry = RegistryManager.new(dbname, update_module=update_module)
File "/home/johan/pycharm_projects/test/odoo/openerp/modules/registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/johan/pycharm_projects/test/odoo/openerp/modules/loading.py", line 273, in load_modules
openerp.modules.db.initialize(cr)
File "/home/johan/pycharm_projects/test/odoo/openerp/modules/db.py", line 68, in initialize
category_id = create_categories(cr, categories)
File "/home/johan/pycharm_projects/test/odoo/openerp/modules/db.py", line 131, in create_categories
VALUES (%s, %s) RETURNING id', (categories[0], p_id))
File "/home/johan/pycharm_projects/test/odoo/openerp/sql_db.py", line 158, in wrapper
return f(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
DataError: value too long for type character varying(128)
当我使用control + C并再次输入命令“./odoo.py -d test”时,一切似乎都可以从终端正常工作,但是当我在浏览器中启动Odoo时,我会进入选择数据库屏幕。 当我选择“测试”数据库时,我收到错误消息“无法登录数据库测试” 在终端中我收到错误消息:
2015-08-12 06:34:24,065 5273 INFO ? openerp: OpenERP version 8.0
2015-08-12 06:34:24,066 5273 INFO ? openerp: addons paths: ['/home/johan/.local/share/Odoo/addons/8.0', u'/home/johan/pycharm_projects/odoo_dev/custom_addons', u'/home/johan/pycharm_projects/odoo_dev/odoo/addons', '/home/johan/pycharm_projects/test/odoo/openerp/addons']
2015-08-12 06:34:24,066 5273 INFO ? openerp: database hostname: localhost
2015-08-12 06:34:24,066 5273 INFO ? openerp: database port: 5432
2015-08-12 06:34:24,066 5273 INFO ? openerp: database user: johan
2015-08-12 06:34:24,176 5273 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-08-12 06:34:24,190 5273 INFO test openerp.modules.loading: loading 1 modules...
2015-08-12 06:34:24,200 5273 INFO test openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2015-08-12 06:34:24,383 5273 INFO test openerp.modules.loading: Modules loaded.
2015-08-12 06:34:37,198 5273 INFO test2 openerp.http: Generating nondb routing
2015-08-12 06:34:37,658 5273 INFO test2 werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:37] "GET / HTTP/1.1" 200 -
2015-08-12 06:34:37,842 5273 INFO ? openerp.addons.bus.bus: Bus.loop listen imbus on db postgres
2015-08-12 06:34:38,141 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:38] "GET /web HTTP/1.1" 303 -
2015-08-12 06:34:38,150 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:38] "GET /favicon.ico HTTP/1.1" 404 -
2015-08-12 06:34:38,390 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:38] "GET /web/database/selector HTTP/1.1" 200 -
2015-08-12 06:34:38,858 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:38] "GET /web/static/src/img/favicon.ico HTTP/1.1" 404 -
2015-08-12 06:34:40,341 5273 INFO ? openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/local/bin/wkhtmltopdf
2015-08-12 06:34:41,468 5273 INFO ? openerp.http: HTTP Configuring static files
2015-08-12 06:34:41,493 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:41] "GET / HTTP/1.1" 200 -
2015-08-12 06:34:43,178 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:43] "GET /web?db=test HTTP/1.1" 302 -
2015-08-12 06:34:43,186 5273 INFO test openerp.addons.base.ir.ir_http: Generating routing map
2015-08-12 06:34:43,230 5273 INFO test werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:43] "GET /web?db=test HTTP/1.1" 200 -
2015-08-12 06:34:43,297 5273 INFO test werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:43] "GET /web/login?redirect=http%3A%2F%2Flocalhost%3A8069%2Fweb%3Fdb%3Dtest HTTP/1.1" 303 -
2015-08-12 06:34:43,365 5273 INFO None werkzeug: 127.0.0.1 - - [12/Aug/2015 06:34:43] "GET /web/database/selector?error=Unable%20to%20login%20on%20database%20test HTTP/1.1" 200 -
2015-08-12 06:35:24,241 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:35:25,198 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:36:24,303 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:36:26,255 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:37:24,342 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:37:27,260 5273 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
我已经尝试了几次,但它只是不起作用。即使使用从Github克隆的全新Odoo实例。
在此之后我在网上看到我不应该使用终端创建数据库,但让Odoo创建一个。
johan@Johan-Laptop:~/pycharm_projects/test/odoo$ cd ..
johan@Johan-Laptop:~/pycharm_projects/test$ cd ..
johan@Johan-Laptop:~/pycharm_projects$ mkdir test2
johan@Johan-Laptop:~/pycharm_projects$ cd ./test2
johan@Johan-Laptop:~/pycharm_projects/test2$ git clone https://github.com/odoo/odoo.git -b 8.0
Cloning into 'odoo'...
remote: Counting objects: 1503424, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 1503424 (delta 7), reused 4 (delta 4), pack-reused 1503397
Receiving objects: 100% (1503424/1503424), 820.71 MiB | 10.19 MiB/s, done.
Resolving deltas: 100% (1248223/1248223), done.
Checking connectivity... done.
Checking out files: 100% (14684/14684), done.
johan@Johan-Laptop:~/pycharm_projects/test2$ cd ./odoo
johan@Johan-Laptop:~/pycharm_projects/test2/odoo$ ./odoo.py
2015-08-12 06:46:26,734 5573 INFO ? openerp: OpenERP version 8.0
2015-08-12 06:46:26,735 5573 INFO ? openerp: addons paths: ['/home/johan/.local/share/Odoo/addons/8.0', u'/home/johan/pycharm_projects/odoo_dev/custom_addons', u'/home/johan/pycharm_projects/odoo_dev/odoo/addons', '/home/johan/pycharm_projects/test2/odoo/openerp/addons']
2015-08-12 06:46:26,735 5573 INFO ? openerp: database hostname: localhost
2015-08-12 06:46:26,735 5573 INFO ? openerp: database port: 5432
2015-08-12 06:46:26,735 5573 INFO ? openerp: database user: johan
2015-08-12 06:46:27,343 5573 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-08-12 06:46:28,533 5573 INFO v8dev openerp.modules.loading: loading 1 modules...
2015-08-12 06:46:28,559 5573 INFO v8dev openerp.modules.loading: 1 modules loaded in 0.03s, 0 queries
2015-08-12 06:46:29,900 5573 INFO v8dev openerp.modules.loading: loading 75 modules...
2015-08-12 06:46:30,029 5573 INFO v8dev passlib.registry: registered crypt handler 'pbkdf2_sha512': <class 'passlib.handlers.pbkdf2.pbkdf2_sha512'>
2015-08-12 06:46:30,030 5573 INFO v8dev passlib.registry: registered crypt handler 'md5_crypt': <class 'passlib.handlers.md5_crypt.md5_crypt'>
2015-08-12 06:46:30,140 5573 INFO ? openerp.addons.bus.bus: Bus.loop listen imbus on db postgres
2015-08-12 06:46:30,356 5573 INFO v8dev openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/local/bin/wkhtmltopdf
2015-08-12 06:46:33,264 5573 INFO v8dev openerp.modules.loading: 75 modules loaded in 3.36s, 0 queries
2015-08-12 06:46:34,969 5573 INFO v8dev openerp.modules.loading: Modules loaded.
在此之后,一切似乎从终端上运行得很好。 我在浏览器中转到Odoo并单击“管理数据库” 我保留默认密码 数据库名称:test2 我没有选中演示数据的复选框。 标准语言:英语 结束我输入两次密码。在这种情况下,我只使用admin
当我创建数据库时,我在屏幕上收到此错误消息:
Odoo Server Error
Traceback (most recent call last):
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 537, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 574, in dispatch
result = self._call_function(**self.params)
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 311, in _call_function
return self.endpoint(*args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 803, in __call__
return self.method(*args, **kw)
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 403, in response_wrap
response = f(*args, **kw)
File "/home/johan/pycharm_projects/odoo_dev/odoo/addons/web/controllers/main.py", line 705, in create
request.session.authenticate(params['db_name'], 'admin', params['create_admin_pwd'])
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 966, in authenticate
if uid: self.get_context()
File "/home/johan/pycharm_projects/test2/odoo/openerp/http.py", line 1001, in get_context
self.context = request.registry.get('res.users').context_get(request.cr, request.uid) or {}
File "/home/johan/pycharm_projects/test2/odoo/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/addons/base/res/res_users.py", line 420, in context_get
return self._context_get(cr, uid)
File "/home/johan/pycharm_projects/test2/odoo/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "<string>", line 2, in _context_get
File "/home/johan/pycharm_projects/test2/odoo/openerp/tools/cache.py", line 74, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/addons/base/res/res_users.py", line 413, in _context_get
res = getattr(user, k) or False
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 817, in __get__
self.determine_value(record)
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 919, in determine_value
self.compute_value(recs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 875, in compute_value
self._compute_value(records)
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 867, in _compute_value
self.compute(records)
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 547, in _compute_related
record[self.name] = other[self.related[-1]]
File "/home/johan/pycharm_projects/test2/odoo/openerp/models.py", line 5574, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 817, in __get__
self.determine_value(record)
File "/home/johan/pycharm_projects/test2/odoo/openerp/fields.py", line 910, in determine_value
record._prefetch_field(self)
File "/home/johan/pycharm_projects/test2/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/models.py", line 3231, in _prefetch_field
result = records.read(list(fnames), load='_classic_write')
File "/home/johan/pycharm_projects/test2/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/models.py", line 3176, in read
self._read_from_database(stored, inherited)
File "/home/johan/pycharm_projects/test2/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/models.py", line 3300, in _read_from_database
cr.execute(query_str, [tuple(sub_ids)] + where_params)
File "/home/johan/pycharm_projects/test2/odoo/openerp/sql_db.py", line 158, in wrapper
return f(self, *args, **kwargs)
File "/home/johan/pycharm_projects/test2/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
ProgrammingError: column res_partner.lang does not exist
LINE 1: SELECT "res_partner"."lang","res_partner"."id" FROM "res_pa...
我单击确定,然后单击按钮再次创建数据库,我得到另一个Odoo警告:数据库'test2'已经存在。
当我按回到右上角登录时,我收到内部服务器错误。
在终端中我收到此错误消息。
2015-08-12 06:52:34,435 5573 WARNING test openerp.addons.base.ir.ir_cron: Skipping database test as its base version is not 8.0.1.3.
2015-08-12 06:52:34,436 5573 WARNING test2 openerp.addons.base.ir.ir_cron: Skipping database test2 as its base version is not 8.0.1.3.
答案 0 :(得分:1)
感谢罗尔,我找到了答案。
我所要做的就是在Odoo directopry中使用适当的参数创建一个openerp-server.conf文件。接下来重新创建数据库,一切正常。