From 8bb6bf4e443236a81517a6c6ee37bd2afb5bdfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 6 Nov 2017 11:38:08 +0100 Subject: [PATCH] [DOC] base: improve error message in asset bundles When compiling a less file in the asset bundles, we make sure that the @import statements are 'sanitized', which is really non intuitive to many developers. With this commit, we simply add more information to the error message, to give them a better chance of not wasting their time. Thank you yenthe for the message... --- odoo/addons/base/ir/ir_qweb/assetsbundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_qweb/assetsbundle.py b/odoo/addons/base/ir/ir_qweb/assetsbundle.py index f2221e9f7cd..e3c0b66f8cc 100644 --- a/odoo/addons/base/ir/ir_qweb/assetsbundle.py +++ b/odoo/addons/base/ir/ir_qweb/assetsbundle.py @@ -388,7 +388,7 @@ class AssetsBundle(object): if '.' not in ref and line not in imports and not ref.startswith(('.', '/', '~')): imports.append(line) return line - msg = "Local import '%s' is forbidden for security reasons." % ref + msg = "Local import '%s' is forbidden for security reasons. Please remove all @import \"your_file.less\" imports in your custom less files. In Odoo you have to import all less files in the assets, and not through the @import statement." % ref _logger.warning(msg) self.css_errors.append(msg) return ''