From 887d7693dc90e25650635e15eaac5a34422e8653 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Thu, 15 Jul 2010 13:55:10 +0530
Subject: [PATCH] [IMP] project: dashboard view improved [REF] project: renamed
type field of project.task into type_id, refactored some code
bzr revid: qdp-launchpad@tinyerp.com-20100715082510-5f7zs3nw7rwomiys
---
addons/project/board_project_view.xml | 28 +++++++++++++++++++++++----
addons/project/project.py | 20 +++++++++----------
addons/project/project_view.xml | 8 ++++----
3 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml
index 5c216e1eaad..a6c489a528d 100644
--- a/addons/project/board_project_view.xml
+++ b/addons/project/board_project_view.xml
@@ -17,13 +17,33 @@
-
-
+
+
+
+
+ project.task.delegated.tree
+ project.task
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
My Open Tasks
project.task
@@ -38,8 +58,8 @@
project.task
form
tree,form
- ['|',('parent_ids.user_id','=',uid),('user_id','=',uid)]
-
+ [('parent_ids.user_id','=',uid),('state', 'in', ('draft','open','pending'))]
+
diff --git a/addons/project/project.py b/addons/project/project.py
index 168e7db7c7c..af8332abb27 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -359,7 +359,7 @@ class task(osv.osv):
'description': fields.text('Description'),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
- 'type': fields.many2one('project.task.type', 'Stage',),
+ 'type_id': fields.many2one('project.task.type', 'Stage',),
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
@@ -549,25 +549,25 @@ class task(osv.osv):
return True
def next_type(self, cr, uid, ids, *args):
- for typ in self.browse(cr, uid, ids):
- typeid = typ.type.id
- types = map(lambda x:x.id, typ.project_id.type_ids or [])
+ for task in self.browse(cr, uid, ids):
+ typeid = task.type_id.id
+ types = map(lambda x:x.id, task.project_id.type_ids or [])
if types:
if not typeid:
- self.write(cr, uid, typ.id, {'type': types[0]})
+ self.write(cr, uid, task.id, {'type_id': types[0]})
elif typeid and typeid in types and types.index(typeid) != len(types)-1 :
index = types.index(typeid)
- self.write(cr, uid, typ.id, {'type': types[index+1]})
+ self.write(cr, uid, task.id, {'type_id': types[index+1]})
return True
def prev_type(self, cr, uid, ids, *args):
- for typ in self.browse(cr, uid, ids):
- typeid = typ.type.id
- types = map(lambda x:x.id, typ.project_id.type_ids)
+ for task in self.browse(cr, uid, ids):
+ typeid = task.type_id.id
+ types = map(lambda x:x.id, task.project_id.type_ids)
if types:
if typeid and typeid in types:
index = types.index(typeid)
- self.write(cr, uid, typ.id, {'type': index and types[index-1] or False})
+ self.write(cr, uid, task.id, {'type_id': index and types[index-1] or False})
return True
task()
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 8fb488478ec..16ed6634558 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -321,7 +321,7 @@
-
+
@@ -354,7 +354,7 @@
icon="gtk-go-forward"
groups="base.group_extended"
help="Change Type"/>
-
+
@@ -441,7 +441,7 @@
-
+
@@ -659,4 +659,4 @@
-
\ No newline at end of file
+