[FIX] loading: set dbdemo if demo install success

opw-1896028

closes odoo/odoo#27945
This commit is contained in:
Adrian Torres
2018-10-19 07:42:30 +00:00
parent 6e97e354d8
commit 0ac93c3828
+1 -1
View File
@@ -103,6 +103,7 @@ def force_demo(cr):
Forces the `demo` flag on all modules, and installs demo data for all installed modules.
"""
graph = odoo.modules.graph.Graph()
cr.execute('UPDATE ir_module_module SET demo=True')
cr.execute(
"SELECT name FROM ir_module_module WHERE state IN ('installed', 'to upgrade', 'to remove')"
)
@@ -112,7 +113,6 @@ def force_demo(cr):
for package in graph:
load_demo(cr, package, {}, 'init')
cr.execute('update ir_module_module set demo=%s', (True,))
env = api.Environment(cr, SUPERUSER_ID, {})
env['ir.module.module'].invalidate_cache(['demo'])