postgresql - 在 odoo 中升级时自定义模块卡住

标签 postgresql python-2.7 server odoo odoo-8

我正在升级 ODOO 中的自定义模块,在生产服务器上,我更新了代码并重新启动了 odoo 服务器。但是当我尝试升级自定义模块时,它会卡住

creating or updating database tables

在本地服务器上工作正常。

这是服务器的日志:

loading 1 modules...
1 modules loaded in 0.02s, 0 queries
loading 54 modules...

INFO openerp.models: Missing many2one field definition for _inherits reference "content_id" in "iris.series", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "video_id" in "iris.ad_video", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "content_id" in "iris.video", using default one.

WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.advertiser" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.

INFO openerp.models: Missing many2one field definition for _inherits reference "stats_id" in "iris.store_playback_stats", using default one.

WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.store_owner" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.

INFO openerp.models: Missing many2one field definition for _inherits reference "category_id" in "iris.business_category", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "video_id" in "iris.partner_video", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "category_id" in "iris.content_category", using default one.

WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.content_partner" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.
WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.subtitler" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.

INFO openerp.modules.module: module module_name: creating or updating database tables

自模块安装开始以来,我收到这些警告消息,但模块已升级。但现在它停留在生产服务器上而不是本地服务器上创建或更新数据库表上。

生产和本地服务器上的数据库是 postgresql。

可能会出现什么问题?我对此进行了研究,但没有得到任何相关的信息。

编辑 1

user_id = fields.Many2one('res.users')

编辑2

我安装了一个自定义模块,它也使用 odoo 的基本模块。我对 XML 和 .py 进行了更改并升级了自定义模块,有时服务器卡在同一点,然后重新启动服务器,然后它就不再卡住了。现在,我还在 .py 中添加了模型并更新了 XML,每当我升级自定义模块时,它都会停留在同一点。即使我也无法安装任何新模块。

最佳答案

正如您上面所说,升级和安装模块时遇到问题需要时间。您可以通过登录数据库并触发此查询来调试该过程,因此您需要检查 Postgres 上运行的锁,这将告诉您您的模块如何花费大量时间来更新。

查询:

select psa.query from pg_locks as pg left join pg_stat_activity as psa on pg.pid=psa.pid where psa.datname='database_name';

关于postgresql - 在 odoo 中升级时自定义模块卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43864590/

相关文章:

python - SQLAlchemy 与 PostgreSQL Unicode 问题

python - Qlocale 和巴西货币格式

python - 如何设置我的 python 代码?

Python 对象 __iter__ 没有被调用

node.js - 如何将 nodejs 应用程序(在本地主机上开发)迁移到已安装 nodejs 的 linux 服务器?

postgresql - 使用 exec 而不是 select 调用函数

ruby-on-rails - 使用 PG 备份将数据库导入 Heroku 上的应用程序

python - psycopg2:在没有索引行的查询中使用列表

java - 如果双击运行如何停止jetty?

java - 在Linux服务器上哪里可以找到 "full path to java binary"?