我正在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
自模块安装开始以来,我收到了这些警告消息,但模块已升级。但现在它停留在生产服务器上creating or updating database tables
而不是本地服务器上。
数据库是生产和本地服务器上的postgresql。
有什么问题?我对它进行了研究,但没有任何相关性。
修改1
user_id = fields.Many2one('res.users')
修改2
我已经安装了一个自定义模块,它也使用了odoo的基本模块。我做了XML和.py更改和升级自定义模块和一些时间服务器卡在同一点,然后重新启动服务器,然后它没有卡住。现在我还在.py和更新的XML中添加了模型,每当我升级我的自定义模块时,它都会停留在同一点上。即使我无法安装任何新模块。
答案 0 :(得分:1)
如上所述,在升级和安装模块时遇到问题需要时间。您可以通过登录数据库并激活此查询来调试该过程,因此您需要检查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';