[REF] gamification
bzr revid: mat@openerp.com-20131217170232-e0zruxzl1wlycaji
This commit is contained in:
parent
c184adab44
commit
4bc29b9ffa
|
@ -81,7 +81,7 @@
|
||||||
<record model="gamification.challenge" id="challenge_base_discover">
|
<record model="gamification.challenge" id="challenge_base_discover">
|
||||||
<field name="name">Complete your Profile</field>
|
<field name="name">Complete your Profile</field>
|
||||||
<field name="period">once</field>
|
<field name="period">once</field>
|
||||||
<field name="visibility_mode">progressbar</field>
|
<field name="visibility_mode">personal</field>
|
||||||
<field name="report_message_frequency">never</field>
|
<field name="report_message_frequency">never</field>
|
||||||
<field name="autojoin_group_id" eval="ref('base.group_user')" />
|
<field name="autojoin_group_id" eval="ref('base.group_user')" />
|
||||||
<field name="state">inprogress</field>
|
<field name="state">inprogress</field>
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
<record model="gamification.challenge" id="challenge_base_configure">
|
<record model="gamification.challenge" id="challenge_base_configure">
|
||||||
<field name="name">Setup your Company</field>
|
<field name="name">Setup your Company</field>
|
||||||
<field name="period">once</field>
|
<field name="period">once</field>
|
||||||
<field name="visibility_mode">progressbar</field>
|
<field name="visibility_mode">personal</field>
|
||||||
<field name="report_message_frequency">never</field>
|
<field name="report_message_frequency">never</field>
|
||||||
<field name="user_ids" eval="[(4, ref('base.user_root'))]" />
|
<field name="user_ids" eval="[(4, ref('base.user_root'))]" />
|
||||||
<field name="state">inprogress</field>
|
<field name="state">inprogress</field>
|
||||||
|
|
|
@ -101,6 +101,11 @@ class gamification_challenge(osv.Model):
|
||||||
res[challenge.id] = False
|
res[challenge.id] = False
|
||||||
|
|
||||||
return res
|
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'
|
_sort = 'end_date, start_date, name, id'
|
||||||
_columns = {
|
_columns = {
|
||||||
|
@ -153,8 +158,8 @@ class gamification_challenge(osv.Model):
|
||||||
'reward_failure': fields.boolean('Reward Bests if not Succeeded?'),
|
'reward_failure': fields.boolean('Reward Bests if not Succeeded?'),
|
||||||
|
|
||||||
'visibility_mode': fields.selection([
|
'visibility_mode': fields.selection([
|
||||||
('progressbar', 'Individual Goals'),
|
('personal', 'Individual Goals'),
|
||||||
('board', 'Leader Board (Group Ranking)'),
|
('ranking', 'Leader Board (Group Ranking)'),
|
||||||
],
|
],
|
||||||
string="Display Mode", required=True),
|
string="Display Mode", required=True),
|
||||||
'report_message_frequency': fields.selection([
|
'report_message_frequency': fields.selection([
|
||||||
|
@ -174,20 +179,16 @@ class gamification_challenge(osv.Model):
|
||||||
help="Never reminded if no value or zero is specified."),
|
help="Never reminded if no value or zero is specified."),
|
||||||
'last_report_date': fields.date('Last Report Date'),
|
'last_report_date': fields.date('Last Report Date'),
|
||||||
'next_report_date': fields.function(_get_next_report_date,
|
'next_report_date': fields.function(_get_next_report_date,
|
||||||
type='date',
|
type='date', string='Next Report Date', store=True),
|
||||||
string='Next Report Date'),
|
|
||||||
|
|
||||||
'category': fields.selection([
|
'category': fields.selection(lambda s, *a, **k: s._get_categories(*a, **k),
|
||||||
('hr', 'Human Ressources / Engagement'),
|
|
||||||
('other', 'Settings / Gamification Tools'),
|
|
||||||
],
|
|
||||||
string="Appears in", help="Define the visibility of the challenge through menus", required=True),
|
string="Appears in", help="Define the visibility of the challenge through menus", required=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'period': 'once',
|
'period': 'once',
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
'visibility_mode': 'progressbar',
|
'visibility_mode': 'personal',
|
||||||
'report_message_frequency': 'never',
|
'report_message_frequency': 'never',
|
||||||
'last_report_date': fields.date.today,
|
'last_report_date': fields.date.today,
|
||||||
'start_date': fields.date.today,
|
'start_date': fields.date.today,
|
||||||
|
@ -521,7 +522,7 @@ class gamification_challenge(osv.Model):
|
||||||
# template_env = TemplateHelper()
|
# template_env = TemplateHelper()
|
||||||
temp_obj = self.pool.get('email.template')
|
temp_obj = self.pool.get('email.template')
|
||||||
ctx = context.copy()
|
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)
|
lines_boards = self.get_board_goal_info(cr, uid, challenge, subset_goal_ids, context)
|
||||||
|
|
||||||
ctx.update({'lines_boards': lines_boards})
|
ctx.update({'lines_boards': lines_boards})
|
||||||
|
|
|
@ -72,7 +72,7 @@ class res_users_gamification_group(osv.Model):
|
||||||
user = self.browse(cr, uid, uid, context=context)
|
user = self.browse(cr, uid, uid, context=context)
|
||||||
serialized_goals_info['currency'] = user.company_id.currency_id.id
|
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
|
# 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)
|
goals_info = challenge_obj.get_board_goal_info(cr, uid, challenge, subset_goal_ids=False, context=context)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
('user_id','=',user.id),
|
('user_id','=',user.id),
|
||||||
'&',
|
'&',
|
||||||
('challenge_id.user_ids','in',user.id),
|
('challenge_id.user_ids','in',user.id),
|
||||||
('challenge_id.visibility_mode','=','board')]</field>
|
('challenge_id.visibility_mode','=','ranking')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="goal_gamification_manager_visibility" model="ir.rule">
|
<record id="goal_gamification_manager_visibility" model="ir.rule">
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<h4><t t-esc="challenge.name" /></h4>
|
<h4><t t-esc="challenge.name" /></h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<t t-if="challenge.visibility_mode == 'progressbar'">
|
<t t-if="challenge.visibility_mode == 'personal'">
|
||||||
<div class="oe_table oe_goals_list">
|
<div class="oe_table oe_goals_list">
|
||||||
<div t-foreach="challenge.goals" t-as="goal" t-attf-class="oe_row oe_goal_outer_box #{goal.state == 'reached' ? 'oe_goal_reached' : ''} #{goal.definition_display != 'progress' ? 'oe_no_progress' : ''}">
|
<div t-foreach="challenge.goals" t-as="goal" t-attf-class="oe_row oe_goal_outer_box #{goal.state == 'reached' ? 'oe_goal_reached' : ''} #{goal.definition_display != 'progress' ? 'oe_no_progress' : ''}">
|
||||||
<t t-if="goal.definition_display == 'progress'">
|
<t t-if="goal.definition_display == 'progress'">
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-if="challenge.visibility_mode == 'board'">
|
<t t-if="challenge.visibility_mode == 'ranking'">
|
||||||
<div t-foreach="challenge.lines" t-as="line" class="oe_goals_list oe_table">
|
<div t-foreach="challenge.lines" t-as="line" class="oe_goals_list oe_table">
|
||||||
<div class="oe_row">
|
<div class="oe_row">
|
||||||
<div class="oe_cell oe_thead" colspan="3" t-attf-title="#{line.definition_description ? line.definition_description : ''}">
|
<div class="oe_cell oe_thead" colspan="3" t-attf-title="#{line.definition_description ? line.definition_description : ''}">
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
<record model="gamification.challenge" id="challenge_crm_sale">
|
<record model="gamification.challenge" id="challenge_crm_sale">
|
||||||
<field name="name">Monthly Sales Targets</field>
|
<field name="name">Monthly Sales Targets</field>
|
||||||
<field name="period">monthly</field>
|
<field name="period">monthly</field>
|
||||||
<field name="visibility_mode">board</field>
|
<field name="visibility_mode">ranking</field>
|
||||||
<field name="autojoin_group_id" eval="ref('base.group_sale_salesman')" />
|
<field name="autojoin_group_id" eval="ref('base.group_sale_salesman')" />
|
||||||
<field name="report_message_frequency">weekly</field>
|
<field name="report_message_frequency">weekly</field>
|
||||||
<field name="report_header">The following message contains the current progress of the sale team based on several criterias. The progress is reinitialised each month and shared weekly.</field>
|
<field name="report_header">The following message contains the current progress of the sale team based on several criterias. The progress is reinitialised each month and shared weekly.</field>
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
<record model="gamification.challenge" id="challenge_crm_marketing">
|
<record model="gamification.challenge" id="challenge_crm_marketing">
|
||||||
<field name="name">Lead Acquisition</field>
|
<field name="name">Lead Acquisition</field>
|
||||||
<field name="period">monthly</field>
|
<field name="period">monthly</field>
|
||||||
<field name="visibility_mode">progressbar</field>
|
<field name="visibility_mode">ranking</field>
|
||||||
<field name="autojoin_group_id" eval="ref('base.group_sale_salesman')" />
|
<field name="autojoin_group_id" eval="ref('base.group_sale_salesman')" />
|
||||||
<field name="report_message_frequency">weekly</field>
|
<field name="report_message_frequency">weekly</field>
|
||||||
<field name="report_header">The following message contains the current progress of the marketing team based on several criterias. The progress is reinitialised each month and shared weekly.</field>
|
<field name="report_header">The following message contains the current progress of the marketing team based on several criterias. The progress is reinitialised each month and shared weekly.</field>
|
||||||
|
|
Loading…
Reference in New Issue