From 2e7347dba5f3bd09deb28a8c91a11d65d13bdd14 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 20 Feb 2015 17:12:34 +0100 Subject: [PATCH] [FIX] translate: possibility to disable translation of view nodes Node content of inherited views using tags are added in the translation terms when syncing the terms. The fact that the content should be translated or not depends on the content, or to which attribute it refers. For instance, string attributes should be translated, but domains probably not. But, even for domains, this is possible that it requires a translation e.g. [('category_id.name', 'ilike', 'Customers')]. This domain is very unlikely to be integrated in the standard source code, but this is possible to have such a domain in a view customization. Therefore, we provide the possibility to disable the translation case by case. Setting translation="off" in the attribute of the node will prevent to add the node content in the translated terms. opw-625762 --- openerp/tools/translate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 073b3d8ed5b..65741424d5e 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -578,6 +578,7 @@ def trans_parse_view(element, callback): for el in element.iter(): if (not isinstance(el, SKIPPED_ELEMENT_TYPES) and el.tag.lower() not in SKIPPED_ELEMENTS + and el.get("translation", '').strip() != "off" and el.text): _push(callback, el.text, el.sourceline) if el.tail: