Search code examples
postgresqlpython-2.7serverodooodoo-8

Custom module stuck while upgrading in odoo


I am upgrading custom module in ODOO and on production server, I updated code and restarted odoo server. But when I try to upgrade custom module then its stucks on

creating or updating database tables

On local server it's work fine.

Here is log of server:

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

I am getting these WARNING messages since beginning of module installation but module was upgraded. But now its stuck on creating or updating database tables on production server not on local server.

Database is postgresql on production and local servers.

What can be issue? I had research on it but did not got anything relevant.

Edit 1

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

Edit 2

I have installed a custom module which also use base modules of odoo. I made XML and .py changes and upgraded custom module and some time server stuck at same point and then restart server then it does not stuck. Now I also added model in .py and updated XML and whenever I upgrade my custom module it stucks at same point. Even I can't install any new module.


Solution

  • As you said above, having issue while upgrading and installation of the module it takes time. You can debug the process by logging in to the database and fire this query so here you need to check the locks which are running on Postgres will tell you about how your module taking a lot of time to updating.

    Query:

    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';