[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
2017-01-06 17:55:04 +01:00
parent de6aaeb546
commit 9073ecb6f5
+4 -2
View File
@@ -404,8 +404,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.')