CLIENT,SERVER: add sum tag on tree view that display sum of the selected lines

bzr revid: ced-29c0dc80cfd619f24d4c96fb8e74708c64a68e8d
This commit is contained in:
ced
2007-06-19 06:25:04 +00:00
parent 5c64b4d14f
commit 655ee8cf3d
2 changed files with 13 additions and 4 deletions
+9 -4
View File
@@ -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 !
#
+4
View File
@@ -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