diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_holidays_attendance | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/hr_holidays_attendance')
| -rw-r--r-- | addons/hr_holidays_attendance/__init__.py | 0 | ||||
| -rw-r--r-- | addons/hr_holidays_attendance/__manifest__.py | 16 | ||||
| -rw-r--r-- | addons/hr_holidays_attendance/views/hr_employee_views.xml | 64 |
3 files changed, 80 insertions, 0 deletions
diff --git a/addons/hr_holidays_attendance/__init__.py b/addons/hr_holidays_attendance/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/addons/hr_holidays_attendance/__init__.py 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 @@ +<?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" model="ir.ui.view"> + <field name="name">hr.employee.holidays.attendance.inherit</field> + <field name="model">hr.employee</field> + <field name="inherit_id" ref="hr_attendance.view_employee_form_inherit_hr_attendance"/> + <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> + +</odoo> |
