summaryrefslogtreecommitdiff
path: root/odoo/modules
diff options
context:
space:
mode:
authorOlivier Dony <odo@odoo.com>2018-12-21 15:56:22 +0100
committerOlivier Dony <odo@odoo.com>2018-12-21 16:01:31 +0100
commiteb19016ba35d4dc4723edcc244fd412680b5ff2f (patch)
treed4c99170e120ff8d69182d68e82354261d71baf0 /odoo/modules
parentf4e7e06a1ff9756471d55138575c758f456b5905 (diff)
[REV] Revert "[FIX] modules: load demo data fallback"
This reverts commit 5f4a9451828fff1919c74e421001bc111c5c138d. The cure is worse than the original disease. The main installation cursor often holds exclusive locks (due to DDL changes) on vital tables such as res_users. As a result, using another cursor to perform changes while the main cursor is waiting is extremely deadlock-prone. And these deadlocks can't be detected by PostgreSQL as they mix Python-SQL locking, which leads to deadlocked HTTP workers. Related to: - opw-1916918 - #29528
Diffstat (limited to 'odoo/modules')
-rw-r--r--odoo/modules/loading.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py
index f63fdde437b..5fb56887948 100644
--- a/odoo/modules/loading.py
+++ b/odoo/modules/loading.py
@@ -89,15 +89,13 @@ def load_demo(cr, package, idref, mode, report=None):
"Module %s demo data failed to install, installed without demo data",
package.name, exc_info=True)
- registry = odoo.registry(cr.dbname)
- with registry.cursor() as cr:
- env = api.Environment(cr, SUPERUSER_ID, {})
- todo = env.ref('base.demo_failure_todo', raise_if_not_found=False)
- Failure = env.get('ir.demo_failure')
- if todo and Failure is not None:
- todo.state = 'open'
- Failure.create({'module_id': package.id, 'error': str(e)})
- return False
+ env = api.Environment(cr, SUPERUSER_ID, {})
+ todo = env.ref('base.demo_failure_todo', raise_if_not_found=False)
+ Failure = env.get('ir.demo_failure')
+ if todo and Failure is not None:
+ todo.state = 'open'
+ Failure.create({'module_id': package.id, 'error': str(e)})
+ return False
def force_demo(cr):