diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml index 60000ec2805..8241da8ac3a 100644 --- a/addons/gamification/data/goal_base.xml +++ b/addons/gamification/data/goal_base.xml @@ -81,7 +81,7 @@ Complete your Profile once - progressbar + personal never inprogress @@ -91,7 +91,7 @@ Setup your Company once - progressbar + personal never inprogress diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 73ad5f4d982..31a22584787 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -101,6 +101,11 @@ class gamification_challenge(osv.Model): res[challenge.id] = False return res + def _get_categories(self, cr, uid, context=None): + return [ + ('hr', 'Human Ressources / Engagement'), + ('other', 'Settings / Gamification Tools'), + ] _sort = 'end_date, start_date, name, id' _columns = { @@ -153,8 +158,8 @@ class gamification_challenge(osv.Model): 'reward_failure': fields.boolean('Reward Bests if not Succeeded?'), 'visibility_mode': fields.selection([ - ('progressbar', 'Individual Goals'), - ('board', 'Leader Board (Group Ranking)'), + ('personal', 'Individual Goals'), + ('ranking', 'Leader Board (Group Ranking)'), ], string="Display Mode", required=True), 'report_message_frequency': fields.selection([ @@ -174,20 +179,16 @@ class gamification_challenge(osv.Model): help="Never reminded if no value or zero is specified."), 'last_report_date': fields.date('Last Report Date'), 'next_report_date': fields.function(_get_next_report_date, - type='date', - string='Next Report Date'), + type='date', string='Next Report Date', store=True), - 'category': fields.selection([ - ('hr', 'Human Ressources / Engagement'), - ('other', 'Settings / Gamification Tools'), - ], + 'category': fields.selection(lambda s, *a, **k: s._get_categories(*a, **k), string="Appears in", help="Define the visibility of the challenge through menus", required=True), } _defaults = { 'period': 'once', 'state': 'draft', - 'visibility_mode': 'progressbar', + 'visibility_mode': 'personal', 'report_message_frequency': 'never', 'last_report_date': fields.date.today, 'start_date': fields.date.today, @@ -521,7 +522,7 @@ class gamification_challenge(osv.Model): # template_env = TemplateHelper() temp_obj = self.pool.get('email.template') ctx = context.copy() - if challenge.visibility_mode == 'board': + if challenge.visibility_mode == 'ranking': lines_boards = self.get_board_goal_info(cr, uid, challenge, subset_goal_ids, context) ctx.update({'lines_boards': lines_boards}) diff --git a/addons/gamification/models/res_users.py b/addons/gamification/models/res_users.py index 0f0144e0710..ef544c95692 100644 --- a/addons/gamification/models/res_users.py +++ b/addons/gamification/models/res_users.py @@ -72,7 +72,7 @@ class res_users_gamification_group(osv.Model): user = self.browse(cr, uid, uid, context=context) serialized_goals_info['currency'] = user.company_id.currency_id.id - if challenge.visibility_mode == 'board': + if challenge.visibility_mode == 'ranking': # board report should be grouped by line for all users goals_info = challenge_obj.get_board_goal_info(cr, uid, challenge, subset_goal_ids=False, context=context) diff --git a/addons/gamification/security/gamification_security.xml b/addons/gamification/security/gamification_security.xml index c783828c7ae..904ba50721e 100644 --- a/addons/gamification/security/gamification_security.xml +++ b/addons/gamification/security/gamification_security.xml @@ -25,7 +25,7 @@ ('user_id','=',user.id), '&', ('challenge_id.user_ids','in',user.id), - ('challenge_id.visibility_mode','=','board')] + ('challenge_id.visibility_mode','=','ranking')] diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml index 6bfd4c2ffc9..19c622dcb97 100644 --- a/addons/gamification/static/src/xml/gamification.xml +++ b/addons/gamification/static/src/xml/gamification.xml @@ -10,7 +10,7 @@

- +
@@ -42,7 +42,7 @@
- +
diff --git a/addons/gamification_sale_crm/sale_crm_goals.xml b/addons/gamification_sale_crm/sale_crm_goals.xml index cc2283d7944..b3dc7e37890 100644 --- a/addons/gamification_sale_crm/sale_crm_goals.xml +++ b/addons/gamification_sale_crm/sale_crm_goals.xml @@ -129,7 +129,7 @@ Monthly Sales Targets monthly - board + ranking weekly The following message contains the current progress of the sale team based on several criterias. The progress is reinitialised each month and shared weekly. @@ -138,7 +138,7 @@ Lead Acquisition monthly - progressbar + ranking weekly The following message contains the current progress of the marketing team based on several criterias. The progress is reinitialised each month and shared weekly.