[IMP] report engine: printscreen: total computation now uses digits attribute from field if present

[FIX] report engine: printscreen: fixed wrong indentation

bzr revid: olt@tinyerp.com-20101004135530-lj37yioz8kcfk0xd
This commit is contained in:
olt@tinyerp.com 2010-10-04 15:55:30 +02:00
parent 1711150d96
commit 85bb4e09bc
1 changed files with 16 additions and 17 deletions

View File

@ -240,16 +240,15 @@ class report_printscreen_list(report_int):
else:
col.text = '/'
node_line = etree.SubElement(lines, 'row')
for f in range(0, len(fields_order)):
col = etree.SubElement(node_line, 'col', para='group', tree='no')
col.set('tree', 'float')
if tsum[f] != None:
if tsum[f] >= 0.01 :
prec = '%.2f'
total = prec%(tsum[f])
if tsum[f] != 0.0:
digits = fields[fields_order[f]].get('digits', (16, 2))
prec = '%%.%sf' % (digits[1], )
total = prec % (tsum[f], )
txt = str(total or '')
else:
txt = str(tsum[f] or '')