[FIX] core: effectively warn on invalid custom views

Since new-api migration of `ir.ui.view`, the method that check views
raises exceptions instead of returning a boolean. Show them as warning.

Related to #14521
This commit is contained in:
Christophe Simonis
2018-04-23 10:12:16 +02:00
parent cd6150fe9e
commit 3bee6ebb0a
+4 -2
View File
@@ -402,8 +402,10 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
if update_module:
Views = registry['ir.ui.view']
for model in registry.models.keys():
if not Views._validate_custom_views(cr, SUPERUSER_ID, model):
_logger.warning('Invalid custom view(s) for model %s', model)
try:
Views._validate_custom_views(cr, SUPERUSER_ID, model)
except Exception as e:
_logger.warning('invalid custom view(s) for model %s: %s', model, tools.ustr(e))
if report.failures:
_logger.error('At least one test failed when loading the modules.')