From 1bfc64477b0f171d9ff05cb4191cf54d9c5f9521 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 7 Nov 2011 18:36:53 +0100 Subject: [PATCH] [IMP] Improved project task kanban view. Changed icon for 'done' state (with al) bzr revid: fme@openerp.com-20111107173653-2bcsu7w145v5orw6 --- addons/project/project.py | 22 +++++++++++++++- addons/project/project_view.xml | 46 +++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index df1995b1f2b..2c647825408 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -431,7 +431,7 @@ class task(osv.osv): 'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority'), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."), 'type_id': fields.many2one('project.task.type', 'Stage'), - 'state': fields.selection([('draft', 'New'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True, + 'state': fields.selection([('draft', 'New'),('open', 'In Progress'),('pending', 'Pending'), ('ready', 'Ready'), ('done', 'Done'), ('cancelled', 'Cancelled')], '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\'.'), 'create_date': fields.datetime('Create Date', readonly=True,select=True), @@ -706,6 +706,10 @@ class task(osv.osv): self.log(cr, uid, t.id, message) return True + def do_ready(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state': 'ready'}, context=context) + return True + def do_draft(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'draft'}, context=context) return True @@ -749,6 +753,22 @@ class task(osv.osv): self.log(cr, uid, id, message) return True + def set_remaining_hours_1(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'remaining_hours': 8.0}, context=context) + return True + + def set_remaining_hours_2(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'remaining_hours': 2 * 8.0}, context=context) + return True + + def set_remaining_hours_5(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'remaining_hours': 5 * 8.0}, context=context) + return True + + def set_remaining_hours_10(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'remaining_hours': 10 * 8.0}, context=context) + return True + def _change_type(self, cr, uid, ids, next, *args): """ go to the next stage diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 2edace937f4..c0b6d6553a3 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -244,7 +244,7 @@ -