[REM] hr_attendance: unused attendance smartbutton
On the res.users form view, a smartbutton was created to appear in very specific situations to inform on the user's last connexion. Since its limited usage, that button is removed from the view. taskID 2958115 closes odoo/odoo#98470 Related: odoo/upgrade#3839 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Yannick Tivisse
parent
3d7367a25e
commit
a91523cef2
@@ -1,19 +0,0 @@
|
||||
odoo.define('hr_attendance.widget', function (require) {
|
||||
"use strict";
|
||||
|
||||
var basic_fields = require('web.basic_fields');
|
||||
var field_registry = require('web.field_registry');
|
||||
|
||||
var RelativeTime = basic_fields.FieldDateTime.extend({
|
||||
_formatValue: function (val) {
|
||||
if (!(val && val._isAMomentObject)) {
|
||||
return;
|
||||
}
|
||||
return val.fromNow(true);
|
||||
},
|
||||
});
|
||||
|
||||
field_registry.add('relative_time', RelativeTime);
|
||||
|
||||
return RelativeTime;
|
||||
});
|
||||
@@ -50,33 +50,6 @@
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="hr.res_users_view_form_profile"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@id='hr_presence_button']" position="attributes">
|
||||
<attribute name="attrs">
|
||||
{'invisible': ['|', ('hr_presence_state', '=', 'absent'), ('attendance_state', '=', 'checked_in')]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<field name="attendance_state" invisible="1"/>
|
||||
<button name="%(hr_attendance_action_my_attendances)d"
|
||||
id="hr_attendance_button"
|
||||
class="oe_stat_button"
|
||||
invisible="context.get('from_my_profile', False)"
|
||||
type="action" attrs="{'invisible': ['|', ('attendance_state', '=', False), '&', ('hr_presence_state', '=', 'present'), ('attendance_state', '=', 'checked_out')]}">
|
||||
<div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon me-1 text-success" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}" aria-label="Available" title="Available"/>
|
||||
<div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon me-1 text-danger" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}" aria-label="Not available" title="Not available"/>
|
||||
<div class="o_stat_info" attrs="{'invisible': ['|', ('last_check_in', '=', False), ('last_check_out', '!=', False)]}">
|
||||
<span class="o_stat_text">Attended Since</span>
|
||||
<span class="o_stat_value"><field name="last_check_in" widget="relative_time"/></span>
|
||||
</div>
|
||||
<div class="o_stat_info" attrs="{'invisible': [('last_check_out', '=', False)]}">
|
||||
<span class="o_stat_text">Not Attended Since</span>
|
||||
<span class="o_stat_value"><field name="last_check_out" widget="relative_time"/></span>
|
||||
</div>
|
||||
<div class="o_stat_info" attrs="{'invisible': [('last_check_in', '!=', False)]}">
|
||||
<span class="o_stat_text">Attendance</span>
|
||||
</div>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<field name="employee_ids" invisible="1"/>
|
||||
<button name="%(hr_attendance_action_employee)d"
|
||||
|
||||
@@ -1,36 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="hr_user_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.user.preferences.view.form.attendance.inherit</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="hr_attendance.hr_user_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Hide Attendance button -->
|
||||
<xpath expr="//button[@id='hr_attendance_button']" position="attributes">
|
||||
<attribute name="attrs">
|
||||
{'invisible': ['|', '|', '&',
|
||||
('hr_presence_state', '=', 'present'),
|
||||
('attendance_state', '=', 'checked_out'),
|
||||
('is_absent', '=', True),
|
||||
('id', '=', False),
|
||||
]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<!-- Merge invisible attr of both module -->
|
||||
<xpath expr="//button[@id='hr_presence_button']" position="attributes">
|
||||
<attribute name="attrs">
|
||||
{'invisible': ['|', '|', '|',
|
||||
('is_absent', '=', True),
|
||||
('hr_presence_state', '=', 'absent'),
|
||||
('attendance_state', '=', 'checked_in'),
|
||||
('id', '=', False),
|
||||
]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_employee_view_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.attendance.employee.view.form.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
||||
Reference in New Issue
Block a user