From 1aeba905db9611e65f66f8d8484be001f82a0795 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 24 Nov 2008 15:23:09 +0530 Subject: [PATCH] total changes in printscreen report-vir bzr revid: patelamit2003@gmail.com-20081124095309-0tasnp02e4b2kjrj --- bin/report/printscreen/ps_list.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index f53106e0e46..5349285b9ba 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -152,8 +152,10 @@ class report_printscreen_list(report_int): for f in fields_order: count += 1 + if fields[f]['type']=='many2one' and line[f]: - line[f] = line[f][1] + line[f]= line[f][1] + if fields[f]['type'] in ('one2many','many2many') and line[f]: line[f] = '( '+str(len(line[f])) + ' )' if fields[f]['type'] == 'float': @@ -181,8 +183,11 @@ class report_printscreen_list(report_int): col.setAttribute('para','yes') col.setAttribute('tree','no') if tsum[f] != None: - total = '%.2f'%(tsum[f]) - txt = new_doc.createTextNode(str(total or '')) + if tsum[f] >= 0.01 : + total = '%.2f'%(tsum[f]) + txt = new_doc.createTextNode(str(total or '')) + else : + txt = new_doc.createTextNode(str(tsum[f] or '')) else: txt = new_doc.createTextNode('/') if f == 0: