diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index b195af35b34..1dc298520eb 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -379,6 +379,11 @@ def load_modules(db, force_demo=False, status=None, update_module=False): models_to_check = set() with db.cursor() as cr: + # prevent endless wait for locks on schema changes (during online + # installs) if a concurrent transaction has accessed the table; + # connection settings are automatically reset when the connection is + # borrowed from the pool + cr.execute("SET SESSION lock_timeout = '15s'") if not odoo.modules.db.is_initialized(cr): if not update_module: _logger.error("Database %s not initialized, you can force it with `-i base`", cr.dbname)