odoo/addons/gamification/plan_view.xml

218 lines
12 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="goal_plan_list_action" model="ir.actions.act_window">
<field name="name">Challenges</field>
<field name="res_model">gamification.goal.plan</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_inprogress':True, 'default_inprogress':True}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a 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="goal_plan_list_view" model="ir.ui.view">
<field name="name">Challenges List</field>
<field name="model">gamification.goal.plan</field>
<field name="arch" type="xml">
<tree string="Goal types" colors="blue:state == 'draft';grey:state == 'done'">
<field name="name"/>
<field name="period"/>
<field name="manager_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="goals_from_plan_act" model="ir.actions.act_window">
<field name="res_model">gamification.goal</field>
<field name="name">Related Goals</field>
<field name="view_mode">kanban,tree</field>
<field name="context">{'search_default_group_by_type': True, 'search_default_inprogress': True, 'search_default_plan_id': active_id, 'default_plan_id': active_id}</field>
<field name="help" type="html">
<p>
There is no goals associated to this challenge matching your search.
Make sure that your challenge is active and assigned to at least one user.
</p>
</field>
</record>
<record id="goal_plan_form_view" model="ir.ui.view">
<field name="name">Challenge Form</field>
<field name="model">gamification.goal.plan</field>
<field name="arch" type="xml">
<form string="Goal types" version="7.0">
<header>
<button string="Start Now" type="object" name="action_start" states="draft" class="oe_highlight"/>
<button string="Check Challenge" type="object" name="action_check" states="inprogress"/>
<button string="Close Challenge" type="object" name="action_close" states="inprogress" class="oe_highlight"/>
<button string="Reset to Draft" type="object" name="action_cancel" states="inprogress"/>
<button string="Reset Completion" type="object" name="action_reset" states="done"/>
<button string="Report Progress" type="object" name="action_report_progress" states="inprogress,done" groups="base.group_no_one"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. Monthly Sales Objectives"/>
</h1>
<label for="user_ids" class="oe_edit_only" string="Assign Challenge To"/>
<div>
<field name="user_ids" widget="many2many_tags" />
</div>
</div>
<!-- action buttons -->
<div class="oe_right oe_button_box">
<button type="action" name="%(goals_from_plan_act)d" string="Related Goals" attrs="{'invisible': [('state','=','draft')]}" />
</div>
<group>
<group>
<field name="period" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="visibility_mode" widget="radio" colspan="1" />
</group>
<group>
<field name="manager_id"/>
<field name="start_date" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="end_date" attrs="{'readonly':[('state','!=','draft')]}"/>
</group>
</group>
<notebook>
<page string="Goals">
<field name="planline_ids" nolabel="1" colspan="4">
<tree string="Planline List" version="7.0" editable="bottom" >
<field name="sequence" widget="handle"/>
<field name="type_id"/>
<field name="type_condition"/>
<field name="target_goal"/>
<field name="type_full_suffix"/>
</tree>
</field>
<field name="description" placeholder="Describe the challenge: what is does, who it targets, why it matters..."/>
</page>
<page string="Reward">
<group>
<field name="reward_id"/>
<field name="reward_first_id" />
<field name="reward_second_id" attrs="{'invisible': [('reward_first_id','=', False)]}" />
<field name="reward_third_id" attrs="{'invisible': ['|',('reward_first_id','=', False),('reward_second_id','=', False)]}" />
<field name="reward_failure" attrs="{'invisible': [('reward_first_id','=', False)]}" />
</group>
<div class="oe_grey">
<p>Badges are granted when a challenge is finished. This is either when at the end of a running period (eg: end of the month for a monthly challenge) or at the end date of a challenge (if no periodicity is set).</p>
<p>Ranking is done on the number of succeeded goals and the percentage of each one.</p>
</div>
</page>
<page string="Advanced Options">
<group string="Subscriptions">
<field name="autojoin_group_id" />
<field name="proposed_user_ids" widget="many2many_tags" />
</group>
<group string="Notification Messages">
<field name="report_message_frequency" />
<field name="report_header" placeholder="e.g. The following message contains the current progress of the sale team..." attrs="{'invisible': [('report_message_frequency','=','never')]}" />
<field name="report_message_group_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
</group>
<group string="Reminders for Manual Goals">
<label for="remind_update_delay" />
<div>
<field name="remind_update_delay" class="oe_inline"/> days
</div>
</group>
<group string="Category" groups="base.group_no_one">
<field name="category" widget="radio" />
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_goal_plan_kanban">
<field name="name">Challenge Kanban</field>
<field name="model">gamification.goal.plan</field>
<field name="arch" type="xml">
<kanban version="7.0" class="oe_background_grey">
<field name="planline_ids"/>
<field name="planline_count"/>
<field name="user_ids"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_goal oe_kanban_global_click">
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<span class="oe_e">í</span>
<ul class="oe_dropdown_menu">
<li><a type="edit">Configure Challenge</a></li>
</ul>
</div>
<div class="oe_kanban_content">
<h4><field name="name"/></h4>
<div class="oe_kanban_project_list">
<a type="action" name="%(goals_from_plan_act)d" style="margin-right: 10px">
<span t-if="record.planline_count.raw_value gt 1"><field name="planline_count"/> Goals</span>
<span t-if="record.planline_count.raw_value lt 2"><field name="planline_count"/> Goal</span>
</a>
</div>
<div class="oe_kanban_badge_avatars">
<t t-foreach="record.user_ids.raw_value.slice(0,11)" t-as="member">
<img t-att-src="kanban_image('res.users', 'image_small', member)" t-att-data-member_id="member"/>
</t>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Planline -->
<record id="goal_planline_list_view" model="ir.ui.view">
<field name="name">Goal planline list</field>
<field name="model">gamification.goal.planline</field>
<field name="arch" type="xml">
<tree string="planline list" >
<field name="type_id"/>
<field name="target_goal"/>
</tree>
</field>
</record>
<record id="goal_plan_search_view" model="ir.ui.view">
<field name="name">Challenge Search</field>
<field name="model">gamification.goal.plan</field>
<field name="arch" type="xml">
<search string="Search Challenges">
<filter name="inprogress" string="Running Challenges"
domain="[('state', '=', 'inprogress')]"/>
<filter name="hr_plans" string="HR Challenges"
domain="[('category', '=', 'hr')]"/>
<field name="name"/>
<group expand="0" string="Group By...">
<filter string="State" domain="[]" context="{'group_by':'state'}"/>
<filter string="Period" domain="[]" context="{'group_by':'period'}"/>
</group>
</search>
</field>
</record>
</data>
</openerp>