From 9fda5984072431b8acfa6557b4d59f4bc43d9133 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 6 Oct 2014 09:53:56 +0200 Subject: [PATCH] [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`. --- openerp/addons/base/ir/ir_ui_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index 3e4efdee8a4..60b09ff91df 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -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