projects
/
OpenERP
/
todolist.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb5b53b
)
Correction division par 0
author
user
<user@debian.inspyration>
Wed, 20 Mar 2013 10:30:48 +0000
(11:30 +0100)
committer
user
<user@debian.inspyration>
Wed, 20 Mar 2013 10:30:48 +0000
(11:30 +0100)
todolist.py
patch
|
blob
|
history
diff --git
a/todolist.py
b/todolist.py
index
14d9f16
..
44061c4
100644
(file)
--- a/
todolist.py
+++ b/
todolist.py
@@
-25,7
+25,7
@@
class Container(osv.Model):
total += 1
if task.state == "done":
done += 1
- result[container.id] = done/total
+ result[container.id] = total and done/total or 0.
return result
@@
-35,7
+35,7
@@
class Container(osv.Model):
tasks = container.tasks
total = len(tasks)
done = len([t for t in tasks if t.state == "done"])
- result[container.id] = done/total*100.
+ result[container.id] = total and done/total or 0.
return result