[IMP] core: more lenient check of custom views
By not marking invalid custom views as a failure, this allow database migrations to not be considered failed for simple errors that can be solved after migration.
This commit is contained in:
@@ -1163,7 +1163,7 @@ class view(osv.osv):
|
||||
cr.execute("""SELECT max(v.id)
|
||||
FROM ir_ui_view v
|
||||
LEFT JOIN ir_model_data md ON (md.model = 'ir.ui.view' AND md.res_id = v.id)
|
||||
WHERE md.module IS NULL
|
||||
WHERE md.module NOT IN (SELECT name FROM ir_module_module)
|
||||
AND v.model = %s
|
||||
AND v.active = true
|
||||
GROUP BY coalesce(v.inherit_id, v.id)
|
||||
|
||||
@@ -394,12 +394,9 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
|
||||
# STEP 6: verify custom views on every model
|
||||
if update_module:
|
||||
Views = registry['ir.ui.view']
|
||||
custom_view_test = True
|
||||
for model in registry.models.keys():
|
||||
if not Views._validate_custom_views(cr, SUPERUSER_ID, model):
|
||||
custom_view_test = False
|
||||
_logger.error('invalid custom view(s) for model %s', model)
|
||||
report.record_result(custom_view_test)
|
||||
_logger.warning('Invalid custom view(s) for model %s', model)
|
||||
|
||||
if report.failures:
|
||||
_logger.error('At least one test failed when loading the modules.')
|
||||
|
||||
Reference in New Issue
Block a user