summaryrefslogtreecommitdiff
path: root/openerp/modules/loading.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-01-06 17:55:04 +0100
committerChristophe Simonis <chs@odoo.com>2017-01-06 17:55:04 +0100
commit9073ecb6f59e1834bdd5e1aed96d6be4b03b00d5 (patch)
treeb1bfb8065f2c9379257eecbc33ce5a1e6a178d0a /openerp/modules/loading.py
parentde6aaeb5468f66283cd221f16e97affacd2a4146 (diff)
[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
Diffstat (limited to 'openerp/modules/loading.py')
-rw-r--r--openerp/modules/loading.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py
index f8bae40ad37..c6c738b07b2 100644
--- a/openerp/modules/loading.py
+++ b/openerp/modules/loading.py
@@ -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.')