[FIX] Bug 364610 : float division error corrected (ref:ANP)

bzr revid: jvo@tinyerp.com-20090422125901-accqqw8f50r88xrh
This commit is contained in:
Jay (Open ERP) 2009-04-22 18:29:01 +05:30
parent be7fd21899
commit afc84be2e7
1 changed files with 5 additions and 2 deletions

View File

@ -208,8 +208,11 @@ class crossovered_budget_lines(osv.osv):
elapsed = min(strToDate(line.date_to),strToDate(date_to)) - max(strToDate(line.date_from),strToDate(date_from))
if strToDate(date_to) < strToDate(line.date_from):
elapsed = strToDate(date_to) - strToDate(date_to)
theo_amt=float(elapsed.days/float(total.days))*line.planned_amount
if total.days:
theo_amt = float(elapsed.days/float(total.days))*line.planned_amount
else:
theo_amt = line.planned_amount
res[line.id]=theo_amt
return res