diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 66b76bea828..3b0cf32433b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1157,10 +1157,15 @@ class orm(object): if node.nodeType == node.ELEMENT_NODE: # translate view - if ('lang' in context) and node.hasAttribute('string') and node.getAttribute('string') and not result: - trans = tools.translate(cr, user, self._name, 'view', context['lang'], node.getAttribute('string').encode('utf8')) - if trans: - node.setAttribute('string', trans.decode('utf8')) + if ('lang' in context) and not result: + if node.hasAttribute('string') and node.getAttribute('string'): + trans = tools.translate(cr, user, self._name, 'view', context['lang'], node.getAttribute('string').encode('utf8')) + if trans: + node.setAttribute('string', trans.decode('utf8')) + if node.hasAttribute('sum') and node.getAttribute('sum'): + trans = tools.translate(cr, user, self._name, 'view', context['lang'], node.getAttribute('sum').encode('utf8')) + if trans: + node.setAttribute('sum', trans.decode('utf8')) # # Add view for properties ! # diff --git a/bin/tools/translate.py b/bin/tools/translate.py index d6f9e11910e..73eb1e8a0c6 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -87,6 +87,10 @@ def trans_parse_view(de): s = de.getAttribute('string') if s: res.append(s.encode("utf8")) + if de.hasAttribute("sum"): + s = de.getAttribute('sum') + if s: + res.append(s.encode("utf8")) for n in [i for i in de.childNodes if (i.nodeType == i.ELEMENT_NODE)]: res.extend(trans_parse_view(n)) return res