From 0562d90529bd43141d1996a13e8760cd5d1b6875 Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP)" Date: Mon, 6 Jan 2014 15:46:43 +0530 Subject: [PATCH 01/21] [IMP]added the legend widget for priority and kanban state bzr revid: mba@tinyerp.com-20140106101643-q71iuge9zojl49s8 --- addons/project/project.py | 13 +++++++------ addons/project/project_view.xml | 30 +++++++++++++++++------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index e42cd8d7247..1e822d6c8f4 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -753,7 +753,7 @@ class task(osv.osv): 'active': fields.function(_is_template, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."), 'name': fields.char('Task Summary', size=128, required=True, select=True), 'description': fields.text('Description'), - 'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True), + 'priority': fields.selection([('0','Very Low'), ('1','Low'), ('2','Medium'), ('3','Important'), ('4','Very important')], 'Priority', select=True), 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of tasks."), 'stage_id': fields.many2one('project.task.type', 'Stage', track_visibility='onchange', domain="[('project_ids', '=', project_id)]"), @@ -821,11 +821,12 @@ class task(osv.osv): 'partner_id': lambda self, cr, uid, ctx=None: self._get_default_partner(cr, uid, context=ctx), } _order = "priority, sequence, date_start, name, id" - - def set_high_priority(self, cr, uid, ids, *args): - """Set task priority to high - """ - return self.write(cr, uid, ids, {'priority' : '0'}) + + def set_kanban_state(self, cr, uid, ids, state, context=None): + self.write(cr, uid, ids, {'kanban_state': state }, context=context); + + def set_priority(self, cr, uid, ids, priority, context=None): + return self.write(cr, uid, ids, {'priority' : str(priority)}, context=context) def set_normal_priority(self, cr, uid, ids, *args): """Set task priority to normal diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 38e8fc9fdef..3630779a9c0 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -374,10 +374,10 @@

- -

@@ -439,7 +439,6 @@ - @@ -511,14 +510,19 @@
- - - - - 7 - 7 - - + + + + + + +
+ + + + + +
- 7 - 7 - + + + + + +
+ + + +
+
-
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index c293c689a5b..60f4ecafb4d 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -27,12 +27,11 @@ from openerp.tools.translate import _ from openerp.tools import html2plaintext AVAILABLE_PRIORITIES = [ - ('', ''), - ('5', 'Not Good'), - ('4', 'On Average'), - ('3', 'Good'), - ('2', 'Very Good'), - ('1', 'Excellent') + ('0', 'Not Good'), + ('1', 'On Average'), + ('2', 'Good'), + ('3', 'Very Good'), + ('4', 'Excellent') ] class hr_recruitment_source(osv.osv): @@ -467,7 +466,7 @@ class hr_applicant(osv.Model): def set_priority(self, cr, uid, ids, priority, *args): """Set applicant priority """ - return self.write(cr, uid, ids, {'priority': priority}) + return self.write(cr, uid, ids, {'priority': str(priority)}) def set_high_priority(self, cr, uid, ids, *args): """Set applicant priority to high diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index bd90ccc9a45..54387490709 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -85,6 +85,7 @@ attrs="{'invisible':[('survey','=',False)]}"/>