From f69ebfcfe698b7e94256c8062fef6e8ef33dc4cc Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Sun, 3 Jun 2018 14:45:28 +0200 Subject: [PATCH] [FIX] qweb: correctly display qweb error message When compiling the qweb template, if an error occurs, an error message is displayed with the corresponding failed node. This messsage was not always correct because the node is modified in place during the compilation proccess. The template is now re-read before displaying the error. --- odoo/addons/base/models/qweb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/addons/base/models/qweb.py b/odoo/addons/base/models/qweb.py index 5294409e090..458bc9a579e 100644 --- a/odoo/addons/base/models/qweb.py +++ b/odoo/addons/base/models/qweb.py @@ -329,6 +329,7 @@ class QWeb(object): raise e except Exception as e: path = _options['last_path_node'] + element, document = self.get_template(template, options) node = element.getroottree().xpath(path) raise QWebException("Error when compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)