Fixed Zero div on tasks
bzr revid: fabian@tinyerp.com-20080903140637-ulg58ttgs50a13q5
This commit is contained in:
parent
7b41f1a679
commit
a8ee852c8b
|
@ -220,10 +220,13 @@ class task(osv.osv):
|
|||
def _progress_rate(self, cursor, user, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for task in self.browse(cursor, user, ids, context=context):
|
||||
tot = 0.0
|
||||
if task.state not in ('draft','cancelled'):
|
||||
tot += task.effective_hours * 100.0 / task.planned_hours
|
||||
res[task.id] = tot
|
||||
if task.state in ('cancelled','done'):
|
||||
res[task.id] = 100.0
|
||||
else:
|
||||
if task.planned_hours:
|
||||
res[task.id] = task.effective_hours * 100.0 / task.planned_hours
|
||||
else:
|
||||
res[task.id] = 0.0
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
|
Loading…
Reference in New Issue