From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/hr_holidays_attendance/__init__.py | 0 addons/hr_holidays_attendance/__manifest__.py | 16 ++++++ .../views/hr_employee_views.xml | 64 ++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 addons/hr_holidays_attendance/__init__.py create mode 100644 addons/hr_holidays_attendance/__manifest__.py create mode 100644 addons/hr_holidays_attendance/views/hr_employee_views.xml (limited to 'addons/hr_holidays_attendance') diff --git a/addons/hr_holidays_attendance/__init__.py b/addons/hr_holidays_attendance/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/addons/hr_holidays_attendance/__manifest__.py b/addons/hr_holidays_attendance/__manifest__.py new file mode 100644 index 00000000..8617224a --- /dev/null +++ b/addons/hr_holidays_attendance/__manifest__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +{ + 'name': "HR Attendance Holidays", + 'summary': """""", + 'category': 'Human Resources', + 'description': """ +Hides the attendance presence button when an employee is on leave. + """, + 'version': '1.0', + 'depends': ['hr_attendance', 'hr_holidays'], + 'auto_install': True, + 'data': [ + 'views/hr_employee_views.xml', + ], + 'license': 'LGPL-3', +} diff --git a/addons/hr_holidays_attendance/views/hr_employee_views.xml b/addons/hr_holidays_attendance/views/hr_employee_views.xml new file mode 100644 index 00000000..53cc6d53 --- /dev/null +++ b/addons/hr_holidays_attendance/views/hr_employee_views.xml @@ -0,0 +1,64 @@ + + + + + hr.user.preferences.view.form.attendance.inherit + res.users + + + + + + {'invisible': ['|', '|', '&', + ('hr_presence_state', '=', 'present'), + ('attendance_state', '=', 'checked_out'), + ('is_absent', '=', True), + ('id', '=', False), + ]} + + + + + + {'invisible': ['|', '|', '|', + ('is_absent', '=', True), + ('hr_presence_state', '=', 'absent'), + ('attendance_state', '=', 'checked_in'), + ('id', '=', False), + ]} + + + + + + + hr.employee.holidays.attendance.inherit + hr.employee + + + + + + {'invisible': ['|', '|', '&', + ('hr_presence_state', '=', 'present'), + ('attendance_state', '=', 'checked_out'), + ('is_absent', '=', True), + ('id', '=', False), + ]} + + + + + + {'invisible': ['|', '|', '|', + ('is_absent', '=', True), + ('hr_presence_state', '=', 'absent'), + ('attendance_state', '=', 'checked_in'), + ('id', '=', False), + ]} + + + + + + -- cgit v1.2.3