[FIX] hr_attendance: fix display issues
- in employee form view: separate "Status" group from "Attendance" group
- make "Attendance" group only visible to attendance officers
this also fixes the use_pin group that would everyone to view pins if enabled
- in employee kanban view, fix the removal of the attendance widget to display
the fa-user icon again, instead of a simple red dot. (commit c468cfdd69 )
This commit is contained in:
committed by
DVE
parent
158f779b46
commit
c60b2c6a14
@@ -98,7 +98,7 @@
|
||||
</page>
|
||||
<page string="HR Settings" groups="hr.group_hr_user">
|
||||
<group>
|
||||
<group string='Attendance' name="active_group">
|
||||
<group string='Status' name="active_group">
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="user_id" string="Related User"/>
|
||||
</group>
|
||||
|
||||
@@ -21,8 +21,8 @@ var FormPresenceIndicator = form_common.AbstractField.extend({
|
||||
return this._super();
|
||||
},
|
||||
render_value: function() {
|
||||
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_green", this.get_value() == 'checked_in');
|
||||
this.$('.oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_red", this.get_value() == 'checked_out');
|
||||
this.$('#oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_green", this.get_value() == 'checked_in');
|
||||
this.$('#oe_hr_attendance_status').toggleClass("oe_hr_attendance_status_red", this.get_value() == 'checked_out');
|
||||
},
|
||||
display_field: function() {
|
||||
this.$el.html(QWeb.render("PresenceIndicator"));
|
||||
|
||||
@@ -7,17 +7,19 @@
|
||||
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.oe_hr_attendance_status {
|
||||
font-size: 1.2em;
|
||||
margin-right: .1em;
|
||||
display: inline-block;
|
||||
color: @odoo-brand-secondary;
|
||||
|
||||
.o_kanban_view #oe_hr_attendance_status {
|
||||
font-size: 1.2em;
|
||||
margin-right: .3em;
|
||||
}
|
||||
|
||||
#oe_hr_attendance_status {
|
||||
color: @odoo-brand-secondary;
|
||||
&.oe_hr_attendance_status_green {
|
||||
color: @brand-success !important;
|
||||
color: @brand-success;
|
||||
}
|
||||
&.oe_hr_attendance_status_red {
|
||||
color: @brand-danger !important;
|
||||
color: @brand-danger;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<template xml:space="preserve">
|
||||
<t t-name="PresenceIndicator">
|
||||
<div class="oe_hr_attendance_status fa fa-user">
|
||||
<div id="oe_hr_attendance_status" class="fa fa-user">
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
@@ -12,11 +12,13 @@
|
||||
<field name="name" placeholder="Employee's Name"/>
|
||||
</div>
|
||||
</field>
|
||||
<field name="user_id" position="after">
|
||||
<field name="barcode" groups="hr_attendance.group_hr_attendance_user"/>
|
||||
<field name="pin" groups="hr_attendance.group_hr_attendance_use_pin"/>
|
||||
<field name="manual_attendance" groups="hr_attendance.group_hr_attendance_user" attrs="{'invisible': [('user_id', '=', False)]}"/>
|
||||
</field>
|
||||
<xpath expr="//group[@name='active_group']" position="after">
|
||||
<group string='Attendance' groups="hr_attendance.group_hr_attendance_user">
|
||||
<field name="barcode"/>
|
||||
<field name="pin" groups="hr_attendance.group_hr_attendance_use_pin"/>
|
||||
<field name="manual_attendance" attrs="{'invisible': [('user_id', '=', False)]}"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -31,8 +33,8 @@
|
||||
<button name="%(hr_attendance_action_employee)d"
|
||||
class="oe_stat_button"
|
||||
type="action" attrs="{'invisible': [('attendance_state', '=', False)]}">
|
||||
<div class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}"/>
|
||||
<div class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status oe_hr_attendance_status_red" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}"/>
|
||||
<div id="oe_hr_attendance_status" class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}"/>
|
||||
<div id="oe_hr_attendance_status" class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status_red" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}"/>
|
||||
<div class="o_stat_info">
|
||||
<span class="o_stat_text">Attendance</span>
|
||||
</div>
|
||||
@@ -59,10 +61,10 @@
|
||||
<div class="oe_kanban_details">
|
||||
<div id="textbox">
|
||||
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_in'">
|
||||
<span class="oe_kanban_status oe_kanban_status_green"></span>
|
||||
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_green"></span>
|
||||
</div>
|
||||
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_out'">
|
||||
<span class="oe_kanban_status oe_kanban_status_red"></span>
|
||||
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_red"></span>
|
||||
</div>
|
||||
<strong>
|
||||
<field name="name"/>
|
||||
@@ -92,10 +94,10 @@
|
||||
<field name="name" position="replace">
|
||||
<div>
|
||||
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_in'">
|
||||
<span class="oe_kanban_status oe_kanban_status_green"></span>
|
||||
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_green"></span>
|
||||
</div>
|
||||
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_out'">
|
||||
<span class="oe_kanban_status oe_kanban_status_red"></span>
|
||||
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_red"></span>
|
||||
</div>
|
||||
<strong>
|
||||
<field name="name" placeholder="Employee's Name"/>
|
||||
|
||||
Reference in New Issue
Block a user