CLIENT,SERVER: add sum tag on tree view that display sum of the selected lines
bzr revid: ced-29c0dc80cfd619f24d4c96fb8e74708c64a68e8d
This commit is contained in:
+9
-4
@@ -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 !
|
||||
#
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user