Since the new views merge, a lot of design elements were broken. This was particularly impacting the fields in the editable list view; indeed the editable list view is not using an inline form view anymore so the fields in the list were not properly styled as the LESS was still defined assuming the form view environment (for example the invalid fields were red for o2m fields in form view but not in editable list view even though they got the right CSS class). This commit refactor the LESS following these rules: - No more division of non-layout and layout rules. Dividing LESS rules in x_layout.less and x.less was a mistake. Many rules can be considered to be layout and not layout at the same time, developers always have to switch from one file part to the other, many CSS selectors (and rules!) are duplicated for nothing, ... - Field style is extracted from x_view.less and put in the new fields.less file. As before, the fields_extra.less will contain the rules specific to community so that the enterprise repo can override those by replacing the whole file. - Many classes have been renamed so that o_form_x_y becomes o_x_y as many classes can now be applied outside of form view. These classes should not be used in templates anyway. The commit also changes the DOM of fields so that it is more minimalist (no useless parent div, etc). Input elements are not automatically styled anymore, they have to get the o_input class explicitely. This allows to fix lots of small style bugs of previous versions (required monetary field had not the proper style, readonly m2m tags appeared as editable, ...). This also improves the LESS code. The editable list view should also completely stop flickering on chrome and firefox. The commit also removes the orange outline on list view dirty cells. The commit also removes deprecated static xml, LESS and other code. Notice there are still styles to restore/fix and LESS to improve.
230 lines
12 KiB
XML
230 lines
12 KiB
XML
<odoo>
|
|
<record id="challenge_list_view" model="ir.ui.view">
|
|
<field name="name">Challenges List</field>
|
|
<field name="model">gamification.challenge</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Goal definitions" decoration-info="state == 'draft'" decoration-muted="state == 'done'">
|
|
<field name="name"/>
|
|
<field name="period"/>
|
|
<field name="manager_id"/>
|
|
<field name="state"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="goals_from_challenge_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_definition': True, 'search_default_inprogress': True, 'search_default_challenge_id': active_id, 'default_challenge_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="challenge_form_view" model="ir.ui.view">
|
|
<field name="name">Challenge Form</field>
|
|
<field name="model">gamification.challenge</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Goal definitions">
|
|
<header>
|
|
<button string="Start Challenge" type="object" name="action_start" states="draft" class="oe_highlight"/>
|
|
<button string="Refresh Challenge" type="object" name="action_check" states="inprogress"/>
|
|
<button string="Send Report" type="object" name="action_report_progress" states="inprogress,done" groups="base.group_no_one"/>
|
|
<field name="state" widget="statusbar" clickable="True"/>
|
|
</header>
|
|
<sheet>
|
|
<!-- action buttons -->
|
|
<div class="oe_button_box" name="button_box">
|
|
<button type="action"
|
|
name="%(goals_from_challenge_act)d"
|
|
class="oe_stat_button"
|
|
icon="fa-gift"
|
|
attrs="{'invisible': [('state','=','draft')]}">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_text">Related</span>
|
|
<span class="o_stat_text">Goals</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
|
|
<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_domain" class="oe_edit_only" string="Assign Challenge To"/>
|
|
<div>
|
|
<field name="user_domain" widget="domain" options="{'model': 'res.users'}" />
|
|
<field name="user_ids" groups="base.group_no_one" widget="many2many_tags" readonly="True" />
|
|
</div>
|
|
</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="line_ids" nolabel="1" colspan="4">
|
|
<tree string="Line List" editable="bottom" >
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="definition_id" />
|
|
<field name="condition"/>
|
|
<field name="target_goal"/>
|
|
<field name="definition_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" attrs="{'required': [('reward_realtime','=', True)]}" />
|
|
<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)]}" />
|
|
<field name="reward_realtime" />
|
|
</group>
|
|
<div class="oe_grey">
|
|
<p>Badges are granted when a challenge is finished. This is either at the end of a running period (eg: end of the month for a monthly challenge), at the end date of a challenge (if no periodicity is set) or when the challenge is manually closed.</p>
|
|
</div>
|
|
</page>
|
|
<page string="Advanced Options">
|
|
<group string="Subscriptions">
|
|
<field name="invited_user_ids" widget="many2many_tags" />
|
|
</group>
|
|
<group string="Notification Messages">
|
|
<div class="oe_grey" colspan="4">
|
|
<p>Depending on the Display mode, reports will be individual or shared.</p>
|
|
</div>
|
|
<group colspan="4">
|
|
<field name="report_message_frequency"/>
|
|
<field name="report_template_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
|
|
<field name="report_message_group_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
|
|
</group>
|
|
</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_challenge_kanban">
|
|
<field name="name">Challenge Kanban</field>
|
|
<field name="model">gamification.challenge</field>
|
|
<field name="arch" type="xml">
|
|
<kanban string="Challenges" class="oe_background_grey">
|
|
<field name="line_ids"/>
|
|
<field name="user_ids"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div t-attf-class="oe_kanban_card o_kanban_gamification oe_kanban_global_click">
|
|
<div class="o_kanban_content">
|
|
<strong>
|
|
<h4 class="text-center"><field name="name"/></h4>
|
|
<div class="oe_kanban_project_list text-center">
|
|
<a type="action" name="%(goals_from_challenge_act)d" style="margin-right: 10px">
|
|
<span t-if="record.line_ids.raw_value.length gt 1"><t t-esc="record.line_ids.raw_value.length"/> Goals</span>
|
|
<span t-if="record.line_ids.raw_value.length lt 2"><t t-esc="record.line_ids.raw_value.length"/> Goal</span>
|
|
</a>
|
|
</div>
|
|
</strong>
|
|
<t t-foreach="record.user_ids.raw_value.slice(0,11)" t-as="member">
|
|
<img class="o_kanban_badge_avatars" t-att-src="kanban_image('res.users', 'image_small', member)" t-att-data-member_id="member"/>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="challenge_list_action" 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="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>
|
|
<!-- Specify form view ID to avoid selecting view_challenge_wizard -->
|
|
<record id="challenge_list_action_view1" model="ir.actions.act_window.view">
|
|
<field eval="1" name="sequence"/>
|
|
<field name="view_mode">kanban</field>
|
|
<field name="act_window_id" ref="challenge_list_action"/>
|
|
<field name="view_id" ref="view_challenge_kanban"/>
|
|
</record>
|
|
<record id="challenge_list_action_view2" model="ir.actions.act_window.view">
|
|
<field eval="10" name="sequence"/>
|
|
<field name="view_mode">form</field>
|
|
<field name="act_window_id" ref="challenge_list_action"/>
|
|
<field name="view_id" ref="challenge_form_view"/>
|
|
</record>
|
|
|
|
<!-- Line -->
|
|
<record id="challenge_line_list_view" model="ir.ui.view">
|
|
<field name="name">Challenge line list</field>
|
|
<field name="model">gamification.challenge.line</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Challenge Lines" >
|
|
<field name="definition_id"/>
|
|
<field name="target_goal"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<record id="challenge_search_view" model="ir.ui.view">
|
|
<field name="name">Challenge Search</field>
|
|
<field name="model">gamification.challenge</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Challenges">
|
|
<filter name="inprogress" string="Running Challenges"
|
|
domain="[('state', '=', 'inprogress')]"/>
|
|
<filter name="hr_challenges" 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>
|
|
</odoo>
|