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:
497b14d
)
Ajout champs fonction pour nb de taches par topics
author
Alicia FLOREZ
<alicflorez@gmail.com>
Wed, 20 Mar 2013 16:33:57 +0000
(17:33 +0100)
committer
Alicia FLOREZ
<alicflorez@gmail.com>
Wed, 20 Mar 2013 16:33:57 +0000
(17:33 +0100)
todolist.py
patch
|
blob
|
history
diff --git
a/todolist.py
b/todolist.py
index
2935ab6
..
3c81f5e
100644
(file)
--- a/
todolist.py
+++ b/
todolist.py
@@
-150,6
+150,14
@@
class Topic(osv.Model):
return result
return result
+ def _get_number_tasks(self, cr, uid, ids, field, arg, context=None):
+ result = 0
+ for topic in self.browse(cr, uid, ids, context=context):
+ for container in self.browse(cr, uid, ids, context=context):
+ result += container.number_tasks
+ return result
+
+
_name = "todolist.topic"
_states = [("Active", "Active"), ("Inactive", "Inactive")]
_name = "todolist.topic"
_states = [("Active", "Active"), ("Inactive", "Inactive")]
@@
-160,6
+168,7
@@
class Topic(osv.Model):
"activated": fields.selection(_states, string="State", select=True),
"todolist_ids": fields.many2many("todolist.container", "todolist_container_topic_rel", "topic_id", "Container_id", string="TO DO Lists"),
"nb_lists": fields.function(_get_nb_lists, type="integer", string="Number of lists"),
"activated": fields.selection(_states, string="State", select=True),
"todolist_ids": fields.many2many("todolist.container", "todolist_container_topic_rel", "topic_id", "Container_id", string="TO DO Lists"),
"nb_lists": fields.function(_get_nb_lists, type="integer", string="Number of lists"),
+ "number_tasks": fields.function(_get_number_tasks, type="integer", string="Number of lists"),
}
_defaults = {
}
_defaults = {