diff options
| author | Kevin Baptiste <kba@odoo.com> | 2020-05-04 14:46:18 +0000 |
|---|---|---|
| committer | Arnaud Joset <arj@odoo.com> | 2020-08-05 12:22:29 +0000 |
| commit | d24de2554e24431f9241c12f7202d4c9960edca0 (patch) | |
| tree | ae83068e24fbcdd467e385c9a087e2a091d50798 /addons/hr_holidays/views | |
| parent | b6489f2763c3f062ab2e5a96b2c804b445f79809 (diff) | |
[IMP] hr,hr_attendance,hr_contract,hr_holidays,hr_presence: update employees presence icons
Make the employee presence icons more descriptive.
Allow to quickly filter the Presence Reports based on the user status.
closes odoo/odoo#54527
Taskid: 2246447
Related: odoo/upgrade#1488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/hr_holidays/views')
| -rw-r--r-- | addons/hr_holidays/views/hr_views.xml | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml index d1a79e078cd..3573d79b523 100644 --- a/addons/hr_holidays/views/hr_views.xml +++ b/addons/hr_holidays/views/hr_views.xml @@ -83,6 +83,33 @@ </field> </record> + <!-- hr_employee_public_view_kanban --> + <record id="hr_kanban_view_public_employees_kanban" model="ir.ui.view"> + <field name="name">hr.employee.public.kanban.leaves.status</field> + <field name="model">hr.employee.public</field> + <field name="inherit_id" ref="hr.hr_employee_public_view_kanban"/> + <field name="arch" type="xml"> + <xpath expr="//templates" position="before"> + <field name="is_absent"/> + </xpath> + <xpath expr="//strong[hasclass('o_kanban_record_title')]" position="inside"> + <!-- Employee is absent, in holiday but he is connected --> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'"> + <span class="fa fa-plane text-success" role="img" aria-label="Present but on leave" + title="Present but on leave" name="presence_absent_active"> + </span> + </div> + <!-- Employee is on holiday, not present and not connected --> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'" + name="presence_absent"> + <span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/> + </div> + </xpath> + </field> + </record> + <record id="hr_kanban_view_employees_kanban" model="ir.ui.view"> <field name="name">hr.employee.kanban.leaves.status</field> <field name="model">hr.employee</field> @@ -93,7 +120,25 @@ <field name="current_leave_state"/> <field name="leave_date_from"/> <field name="leave_date_to"/> + <field name="is_absent"/> </xpath> + <xpath expr="//div[@name='presence_absent_active']" position="after"> + <!-- Employee is absent, in holiday but he is connected --> + <!-- green plane --> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'"> + <span class="fa fa-plane text-success" role="img" aria-label="Present but on leave" + title="Present but on leave" name="presence_absent_active"> + </span> + </div> + <!-- Employee is on holiday, not present and not connected --> + <!-- orange plane --> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'" + name="presence_absent"> + <span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/> + </div> + </xpath> <xpath expr="//li[@id='last_login']" position="inside"> <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%" t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'" @@ -125,11 +170,15 @@ <field name="current_leave_id" invisible="1"/> <field name="show_leaves" invisible="1"/> <field name="is_absent" invisible="1"/> + <field name="hr_icon_display" invisible="1"/> <button disabled="1" class="oe_stat_button" context="{'search_default_employee_id': active_id}" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Off Till" title="Off Till"/> + <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}" + role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/> + <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img" + class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> @@ -183,10 +232,14 @@ <field name="current_leave_id" invisible="1"/> <field name="show_leaves" invisible="1"/> <field name="is_absent" invisible="1"/> + <field name="hr_icon_display" invisible="1"/> <button disabled="1" class="oe_stat_button" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/> + <div role="img" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}" + class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/> + <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img" + class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> @@ -194,6 +247,7 @@ <span class="o_stat_text"> Off Till </span> + <t t-esc="hr_icon_display == 'presence_holiday_present'"/> </div> </button> </xpath> @@ -225,11 +279,17 @@ <field name="show_leaves" invisible="1"/> <field name="employee_ids" invisible="1"/> <field name="is_absent" invisible="1"/> + <field name="hr_icon_display" invisible="1"/> <button name="%(hr_leave_action_new_request)d" type="action" class="oe_stat_button" invisible="context.get('from_my_profile', False)" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Off Till" title="Off Till"/> + <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}" + role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" + title="Off Till"/> + <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" + role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" + title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> |
