diff --git a/addons/gamification/goal_base_data.xml b/addons/gamification/goal_base_data.xml index ebb5e518aae..6b383a59291 100644 --- a/addons/gamification/goal_base_data.xml +++ b/addons/gamification/goal_base_data.xml @@ -60,6 +60,7 @@ never inprogress + other @@ -67,8 +68,9 @@ once progressbar never - + inprogress + other diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py index 56c41c63996..e47c2b356a9 100644 --- a/addons/gamification/plan.py +++ b/addons/gamification/plan.py @@ -143,8 +143,7 @@ class gamification_goal_plan(osv.Model): ('progressbar', 'Individual Goals'), ('board', 'Leader Board (Group Ranking)'), ], - string="Display Mode", - required=True), + string="Display Mode", required=True), 'report_message_frequency': fields.selection([ ('never','Never'), ('onchange','On change'), @@ -153,8 +152,7 @@ class gamification_goal_plan(osv.Model): ('monthly','Monthly'), ('yearly', 'Yearly') ], - string="Report Frequency", - required=True), + string="Report Frequency", required=True), 'report_message_group_id': fields.many2one('mail.group', string='Send a copy to', help='Group that will receive a copy of the report in addition to the user'), @@ -165,6 +163,12 @@ class gamification_goal_plan(osv.Model): 'next_report_date': fields.function(_get_next_report_date, type='date', string='Next Report Date'), + + 'category': fields.selection([ + ('hr', 'Human Ressources'), + ('other', 'Other'), + ], + string="Category", help="Only HR plans can be accessed by managers", required=True) } _defaults = { @@ -175,6 +179,7 @@ class gamification_goal_plan(osv.Model): 'last_report_date': fields.date.today, 'start_date': fields.date.today, 'manager_id': lambda s, cr, uid, c: uid, + 'category': 'hr', } def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/gamification/plan_view.xml b/addons/gamification/plan_view.xml index f305eb13192..ca876e47236 100644 --- a/addons/gamification/plan_view.xml +++ b/addons/gamification/plan_view.xml @@ -93,7 +93,7 @@ - + @@ -112,6 +112,9 @@ days + + + @@ -184,6 +187,8 @@ + diff --git a/addons/gamification/security/gamification_security.xml b/addons/gamification/security/gamification_security.xml index a488d27e88b..d68181c1e0c 100644 --- a/addons/gamification/security/gamification_security.xml +++ b/addons/gamification/security/gamification_security.xml @@ -1,6 +1,6 @@ - + Gamification @@ -11,9 +11,7 @@ - - User can only see his/her goals or goal from the same plan in board visibility diff --git a/addons/gamification/static/src/css/goal.css b/addons/gamification/static/src/css/goal.css index 0856bd60135..f6c38ea1ccb 100644 --- a/addons/gamification/static/src/css/goal.css +++ b/addons/gamification/static/src/css/goal.css @@ -2,7 +2,7 @@ .openerp .oe_kanban_view .oe_kanban_card.oe_kanban_goal, .openerp .oe_kanban_view .oe_kanban_card.oe_kanban_badge { width: 220px; - min-height: 160px; + min-height: 150px; } .oe_kanban_badge_avatars { diff --git a/addons/gamification/static/src/js/gamification.js b/addons/gamification/static/src/js/gamification.js index 220f69cdfd2..87550914ecc 100644 --- a/addons/gamification/static/src/js/gamification.js +++ b/addons/gamification/static/src/js/gamification.js @@ -125,14 +125,14 @@ openerp.gamification = function(instance) { if (self.view.dataset.model === 'gamification.goal' && self.$el.find('.oe_goal_gauge').length == 1) { var unique_id = _.uniqueId("goal_gauge_"); self.$el.find('.oe_goal_gauge').attr('id', unique_id); - + console.log(self.record); var g = new JustGage({ id: unique_id, node: self.$el.find('.oe_goal_gauge').empty().get(0), value: self.record.current.raw_value, min: 0, max: self.record.target_goal.raw_value, - title: self.record.type_id.value, + // title: self.record.type_id.value, relativeGaugeSize: true, levelColors: [ "#f9c802", diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml index 9dfebe14f62..3a068dab045 100644 --- a/addons/gamification/static/src/xml/gamification.xml +++ b/addons/gamification/static/src/xml/gamification.xml @@ -10,14 +10,11 @@
  • + modify -

    / diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 83f5f4a515d..29669eec1d6 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -109,13 +109,13 @@ class hr_employee(osv.osv): """Return the list of goals assigned to the employee""" res = {} for employee in self.browse(cr, uid, ids, context=context): - res[employee.id] = self.pool.get('gamification.goal').search(cr,uid,[('user_id','=',employee.user_id.id)], context=context) + res[employee.id] = self.pool.get('gamification.goal').search(cr,uid,[('user_id', '=', employee.user_id.id), ('plan_id.category', '=', 'hr')], context=context) return res _columns = { 'evaluation_plan_id': fields.many2one('hr_evaluation.plan', 'Appraisal Plan'), 'evaluation_date': fields.date('Next Appraisal Date', help="The date of the next appraisal is computed by the appraisal plan's dates (first appraisal + periodicity)."), - 'goal_ids': fields.function(_get_employee_goals, type="one2many", obj='gamification.goal', string="Employee Goals") + 'goal_ids': fields.function(_get_employee_goals, type="one2many", obj='gamification.goal', string="Employee HR Goals") } def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None): now = parser.parse(datetime.now().strftime('%Y-%m-%d')) diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 888c77eb808..5f8f6e599c7 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -419,11 +419,17 @@ Goals History tree,kanban {'search_default_group_by_user': True, 'search_default_group_by_type': True} + [('plan_id.category', '=', 'hr')] + + + + + [('category', '=', 'hr')] - + diff --git a/addons/hr_gamification/badge.py b/addons/hr_gamification/badge.py index 1e99ce39eb0..9f7fc2e4fd1 100644 --- a/addons/hr_gamification/badge.py +++ b/addons/hr_gamification/badge.py @@ -105,7 +105,6 @@ class hr_grant_badge_wizard(osv.TransientModel): badge_obj.send_badge(cr, uid, wiz.badge_id.id, [badge_user], user_from=user_from, context=context) return {} -hr_grant_badge_wizard() class hr_employee(osv.osv): diff --git a/addons/hr_gamification/badge_view.xml b/addons/hr_gamification/badge_view.xml index a3b8771db5e..98161d47f1c 100644 --- a/addons/hr_gamification/badge_view.xml +++ b/addons/hr_gamification/badge_view.xml @@ -67,14 +67,13 @@