summaryrefslogtreecommitdiff
path: root/odoo/modules/loading.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/modules/loading.py')
-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):