From 25388630ccd803d34c74679ca80d50833d2ef056 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 2 Jul 2013 18:41:57 +0200 Subject: [PATCH] [FIX] views: distribute branding only if not t-* attributes bzr revid: chs@openerp.com-20130702164157-nsfq9xpswj0r56ry --- openerp/addons/base/ir/ir_ui_view.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index 2cfcd33dfff..995f730712a 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -758,10 +758,11 @@ class view(osv.osv): if e.attrib.get(i): branding_dist[i] = e.attrib.get(i) e.attrib.pop(i) - count = {} - for child in e: - count[child.tag] = count.get(child.tag, 0) + 1 - self.distribute_branding(child, branding_dist, xpath, count) + if not re.search('(t-esc=|t-raw=|t-field=|t-call=)',child_text) or e.tag == "t": + count = {} + for child in e: + count[child.tag] = count.get(child.tag, 0) + 1 + self.distribute_branding(child, branding_dist, xpath, count) def render(self, cr, uid, id_or_xml_id, values, context=None): def loader(name): @@ -770,7 +771,6 @@ class view(osv.osv): arch_tree = etree.fromstring(arch) self.distribute_branding(arch_tree) arch = etree.tostring(arch_tree, encoding='utf-8') - arch = '%s' % (name.encode('utf-8'), arch) return arch