[IMP] core: do not log 'loading demo' for nothing

when there is no demo data available for the given module

closes odoo/odoo#83675

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2022-01-31 16:52:42 +00:00
parent 5cf5a4bcff
commit 34022a35aa
+4 -3
View File
@@ -81,9 +81,10 @@ def load_demo(cr, package, idref, mode):
return False
try:
_logger.info("Module %s: loading demo", package.name)
with cr.savepoint(flush=False):
load_data(cr, idref, mode, kind='demo', package=package)
if package.data.get('demo') or package.data.get('demo_xml'):
_logger.info("Module %s: loading demo", package.name)
with cr.savepoint(flush=False):
load_data(cr, idref, mode, kind='demo', package=package)
return True
except Exception as e:
# If we could not install demo data for this module