[MERGE] from trunk-fix-1084424: use abs(v)<epsilon when checking a small difference between 2 values

bzr revid: chm@openerp.com-20121203151655-1eehju2e61mtlfxw
This commit is contained in:
Christophe Matthieu 2012-12-03 16:16:55 +01:00
commit 385986cc9d
1 changed files with 2 additions and 2 deletions

View File

@ -106,10 +106,10 @@ class base_report(report_sxw.rml_parse):
value=line["debit"]-line["credit"]
elif(type == "D"):
value=line["debit"]-line["credit"]
if(value<0.001): value=0.0
if(abs(value)<0.001): value=0.0
elif(type == "C"):
value=line["credit"]-line["debit"]
if(value<0.001): value=0.0
if(abs(value)<0.001): value=0.0
if(operator == '+'):
sum += value
else: