diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_gamification/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/hr_gamification/views')
| -rw-r--r-- | addons/hr_gamification/views/gamification_templates.xml | 10 | ||||
| -rw-r--r-- | addons/hr_gamification/views/gamification_views.xml | 69 | ||||
| -rw-r--r-- | addons/hr_gamification/views/hr_employee_views.xml | 52 |
3 files changed, 131 insertions, 0 deletions
diff --git a/addons/hr_gamification/views/gamification_templates.xml b/addons/hr_gamification/views/gamification_templates.xml new file mode 100644 index 00000000..edf3195d --- /dev/null +++ b/addons/hr_gamification/views/gamification_templates.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <template id="assets_backend" name="hr_gamification assets" inherit_id="web.assets_backend"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/hr_gamification/static/src/js/gamification.js"></script> + </xpath> + </template> + +</odoo> diff --git a/addons/hr_gamification/views/gamification_views.xml b/addons/hr_gamification/views/gamification_views.xml new file mode 100644 index 00000000..c2b378fa --- /dev/null +++ b/addons/hr_gamification/views/gamification_views.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<odoo> + + <record id="hr_badge_form_view" model="ir.ui.view"> + <field name="name">gamification.badge.form.inherit</field> + <field name="model">gamification.badge</field> + <field name="inherit_id" ref="gamification.badge_form_view"/> + <field name="arch" type="xml"> + <div name="button_box" position="inside"> + <button class="oe_stat_button" type="object" name="get_granted_employees" attrs="{'invisible': [('granted_count','=',0)]}" icon="fa-user"> + <field name="granted_employees_count" string="Granted" widget="statinfo"/> + </button> + </div> + </field> + </record> + + <record id="goals_menu_groupby_action2" model="ir.actions.act_window"> + <field name="res_model">gamification.goal</field> + <field name="name">Goals History</field> + <field name="view_mode">tree,kanban</field> + <field name="context">{'search_default_group_by_user': True, 'search_default_group_by_definition': True}</field> + <field name="domain">[('challenge_id.challenge_category', '=', 'hr')]</field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new goal + </p><p> + A goal is defined by a user and a goal type. + Goals can be created automatically by using challenges. + </p> + </field> + </record> + + + <record id="challenge_list_action2" model="ir.actions.act_window"> + <field name="name">Challenges</field> + <field name="res_model">gamification.challenge</field> + <field name="view_mode">kanban,tree,form</field> + <field name="domain">[('challenge_category', '=', 'hr')]</field> + <field name="context">{'search_default_inprogress':True, 'default_inprogress':True}</field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new challenge + </p><p> + Assign a list of goals to chosen users to evaluate them. + The challenge can use a period (weekly, monthly...) for automatic creation of goals. + The goals are created for the specified users or member of the group. + </p> + </field> + </record> + <record id="challenge_list_action2_view1" model="ir.actions.act_window.view"> + <field name="sequence" eval="1"/> + <field name="view_mode">kanban</field> + <field name="act_window_id" ref="challenge_list_action2"/> + <field name="view_id" ref="gamification.view_challenge_kanban"/> + </record> + <record id="challenge_list_action2_view2" model="ir.actions.act_window.view"> + <field name="sequence" eval="10"/> + <field name="view_mode">form</field> + <field name="act_window_id" ref="challenge_list_action2"/> + <field name="view_id" ref="gamification.challenge_form_view"/> + </record> + + <menuitem id="menu_hr_gamification" parent="hr.menu_human_resources_configuration" name="Challenges" sequence="100"/> + + <menuitem id="gamification_badge_menu_hr" parent="menu_hr_gamification" action="gamification.badge_list_action" /> + <menuitem id="gamification_challenge_menu_hr" parent="menu_hr_gamification" action="challenge_list_action2" groups="hr.group_hr_user"/> + <menuitem id="gamification_goal_menu_hr" parent="menu_hr_gamification" action="goals_menu_groupby_action2" groups="hr.group_hr_user"/> + +</odoo> diff --git a/addons/hr_gamification/views/hr_employee_views.xml b/addons/hr_gamification/views/hr_employee_views.xml new file mode 100644 index 00000000..f489a73a --- /dev/null +++ b/addons/hr_gamification/views/hr_employee_views.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="hr_hr_employee_view_form" model="ir.ui.view"> + <field name="name">hr.employee.view.form.inherit</field> + <field name="model">hr.employee</field> + <field name="inherit_id" ref="hr.view_employee_form"/> + <field name="arch" type="xml"> + + <xpath expr="//page[@name='public']" position="after"> + <page string="Received Badges" name="received_badges" attrs="{'invisible': [('user_id', '=', False)]}"> + <field name="has_badges" invisible="1"/> + <button string="Grant a Badge" type="action" name="%(action_reward_wizard)d"/> to reward this employee for a good action + <div class="o_field_nocontent" attrs="{'invisible': [('has_badges', '=', True)]}"> + <p> + Grant this employee his first badge + </p><p class="oe_grey"> + Badges are rewards of good work. Give them to people you believe deserve it. + </p> + </div> + <field name="badge_ids" mode="kanban" widget="many2many"/> + </page> + </xpath> + + </field> + </record> + + <record id="hr_employee_public_view_form" model="ir.ui.view"> + <field name="name">hr.employee.public.view.form.inherit</field> + <field name="model">hr.employee.public</field> + <field name="inherit_id" ref="hr.hr_employee_public_view_form"/> + <field name="arch" type="xml"> + + <xpath expr="//page[@name='public']" position="after"> + <page string="Received Badges" name="received_badges" attrs="{'invisible': [('user_id', '=', False)]}"> + <field name="has_badges" invisible="1"/> + <button string="Grant a Badge" type="action" name="%(action_reward_wizard)d"/> to reward this employee for a good action + <div class="o_field_nocontent" attrs="{'invisible': [('has_badges', '=', True)]}"> + <p> + Grant this employee his first badge + </p><p class="oe_grey"> + Badges are rewards of good work. Give them to people you believe deserve it. + </p> + </div> + <field name="badge_ids" mode="kanban" widget="many2many"/> + </page> + </xpath> + + </field> + </record> + +</odoo> |
