From fbfdca6eb047c648039b82ca5b7b6efad5e6a550 Mon Sep 17 00:00:00 2001
From: "nch@tinyerp.com" <>
Date: Thu, 4 Feb 2010 11:43:10 +0530
Subject: [PATCH] [IMP]:improved project task and project_gtd view set them
according to context
bzr revid: nch@tinyerp.com-20100204061310-w7zxlxd4uquc98j0
---
addons/project/project_view.xml | 20 +++++++------
addons/project_gtd/project_gtd.py | 25 ++++++++--------
addons/project_gtd/project_gtd_view.xml | 40 +++++--------------------
3 files changed, 32 insertions(+), 53 deletions(-)
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 1e75b2a9a82..cdb5e0912c4 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -361,22 +361,24 @@
-
+
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py
index 1f2927e06f5..e21233fa3ef 100644
--- a/addons/project_gtd/project_gtd.py
+++ b/addons/project_gtd/project_gtd.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -49,7 +49,7 @@ class project_gtd_context(osv.osv):
'sequence': lambda *args: 1
}
_order = "sequence, name"
-
+
project_gtd_context()
@@ -61,7 +61,7 @@ class project_gtd_timebox(osv.osv):
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of timebox."),
'icon': fields.selection(tools.icons, 'Icon', size=64),
}
-
+
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(project_gtd_timebox,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if (res['type']=='form') and ('record_id' in context):
@@ -123,14 +123,14 @@ class project_task(osv.osv):
'timebox_id': fields.many2one('project.gtd.timebox', "Timebox"),
'context_id': fields.many2one('project.gtd.context', "Context"),
}
-
+
def copy_data(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
default['timebox_id']=False
default['context_id']=False
return super(project_task,self).copy_data(cr, uid, id, default, context)
-
+
def _get_context(self,cr, uid, ctx):
ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=ctx)
return ids and ids[0] or False
@@ -169,19 +169,20 @@ class project_task(osv.osv):
timebox_obj = self.pool.get('project.gtd.timebox')
if res['type'] == 'search':
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]))
- search_extended ='''''' % (len(tt)+6,_('Getting Things Done'))
- search_extended += ''''''
+ search_extended ='''''' % (len(tt)+7,_('Getting Things Done'))
+ search_extended += ''''''
+ search_extended += ''''''
search_extended += ''''''
for time in tt:
if time.icon:
icon = time.icon
else :
icon=""
- search_extended += ''''''
+ search_extended += ''''''
search_extended += '''
-
-
+
+
'''
if search_extended:
@@ -191,7 +192,7 @@ class project_task(osv.osv):
context_id_info['context_id']['selection'] = attrs_sel
res['fields'].update(context_id_info)
return res
-
+
# Override read for using this method if context set !!!
#_order = "((55-ascii(coalesce(priority,'2')))*2 + coalesce((date_start::date-current_date)/2,8))"
project_task()
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index b15a0752206..1d5bb08c200 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -75,9 +75,9 @@
-
-
-
+
+
+
@@ -92,6 +92,7 @@
+
@@ -100,38 +101,13 @@
Tasks
project.task
tree
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
- project.task
- form
- tree,form,calendar,graph
-
-
-
-
-
-