[FIX] load view from file shall not raise an exception
In --dev mode, when a view can't be loaded from the file in spite of being referenced in field `arch_fs`, the current behavior is to raise an exception. In most cases, developpers don't want the view to fail so the behavior has been changed in favor of a logger warning and a fallback to `arch_db`.
This commit is contained in:
@@ -129,7 +129,8 @@ def get_view_arch_from_file(filename, xmlid):
|
||||
node.tag = 'data'
|
||||
node.attrib.pop('id', None)
|
||||
return etree.tostring(node)
|
||||
raise ValueError("Could not find view arch definition in file '%s' for xmlid '%s'" % (filename, xmlid))
|
||||
_logger.warning("Could not find view arch definition in file '%s' for xmlid '%s'" % (filename, xmlid))
|
||||
return None
|
||||
|
||||
xpath_utils = etree.FunctionNamespace(None)
|
||||
xpath_utils['hasclass'] = _hasclass
|
||||
|
||||
Reference in New Issue
Block a user