diff --git a/hr_attendance_hour_type_report/README.rst b/hr_attendance_hour_type_report/README.rst new file mode 100644 index 00000000..9d3a5684 --- /dev/null +++ b/hr_attendance_hour_type_report/README.rst @@ -0,0 +1,107 @@ +========================== +HR Attendance hours report +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ce99258fcffd837ed56010390e15c1865cb4ec2585299cfac06d8d5acd4aaef0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--attendance-lightgray.png?logo=github + :target: https://github.com/OCA/hr-attendance/tree/14.0/hr_attendance_hour_type_report + :alt: OCA/hr-attendance +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-attendance-14-0/hr-attendance-17-0-hr_attendance_hour_type_report + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/hr-attendance&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides a new report in hr_attendance to display the worked time of employees split in +the following categories: + +* type of day (weekday, sunday, holiday) +* daytime / nighttime + +The information of a day being a holiday comes from the configured public holidays from the module hr_holidays_public. + +This is meant as a helper for people interacting with external payroll systems. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +There is a new setting in the Attendance settings to set on the company the +hour at which the night worktime starts and ends. The default is from 10pm to +6am. + +These hours are expressed in the employee's time zone. + +Usage +===== + +Go to Attendances -> Attendances for Payroll, you will see a list view or a pivot view of attendances with the following values: + +* date (using the check in datetime, converted to the date in the employee's timezone +* date type (normal, sunday or holiday) +* daytime work duration +* nighttime work duration +* total work duration + +The list view and pivot view can be exported to a spreadsheet for further processing. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Alexandre Fayolle +* Cédric Pigeon + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/hr-attendance `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_attendance_hour_type_report/__init__.py b/hr_attendance_hour_type_report/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/hr_attendance_hour_type_report/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/hr_attendance_hour_type_report/__manifest__.py b/hr_attendance_hour_type_report/__manifest__.py new file mode 100644 index 00000000..c70cdb27 --- /dev/null +++ b/hr_attendance_hour_type_report/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "HR Attendance hours report", + "version": "17.0.1.0.0", + "category": "Human Resources", + "website": "https://github.com/OCA/hr-attendance", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "hr_attendance", + "hr_holidays", + ], + "data": [ + "views/res_config_settings.xml", + "views/hr_attendance.xml", + ], + "installable": True, +} diff --git a/hr_attendance_hour_type_report/i18n/es.po b/hr_attendance_hour_type_report/i18n/es.po new file mode 100644 index 00000000..f0c66552 --- /dev/null +++ b/hr_attendance_hour_type_report/i18n/es.po @@ -0,0 +1,169 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_attendance_hour_type_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-10 21:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"" +msgstr "" +"" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_hr_attendance +msgid "Attendance" +msgstr "Asistencias" + +#. module: hr_attendance_hour_type_report +#: model:ir.actions.act_window,name:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "Attendances for Payroll" +msgstr "Asistencias para el cálculo de la Nómina" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "Beginning of night work time" +msgstr "Comienzo del trabajo nocturno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes Config" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "Date" +msgstr "Fecha" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date_type +msgid "Date Type" +msgstr "Fecha Tipo" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Date type" +msgstr "Fecha tipo" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_daytime +msgid "Day hours" +msgstr "Horario diurno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +msgid "End of night work time" +msgstr "Fin del horario de trabajo nocturno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: hr_attendance_hour_type_report +#: code:addons/hr_attendance_hour_type_report/models/hr_attendance.py:0 +#, python-format +msgid "More than 24h of work in 1 shift is forbidden" +msgstr "Prohibido trabajar más de 24h en 1 turno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_nighttime +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "Night hours" +msgstr "Horario nocturno" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "No attendance records found" +msgstr "No se han encontrado registros de asistencia" + +#. module: hr_attendance_hour_type_report +#: model:ir.ui.menu,name:hr_attendance_hour_type_report.menu_hr_attendance_report +msgid "Payroll Report" +msgstr "Informe de Nómina" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Payroll date" +msgstr "Fecha de la nómina" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__holiday +msgid "Public Holiday" +msgstr "Vacaciones Públicas" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"Set the begining and end of the night work period. This is set in the " +"company's timezone (configured on the partner of the company)." +msgstr "" +"Establezca el comienzo y el final del periodo de trabajo nocturno. Esto se " +"establece en la zona horaria de la empresa (configurada en el socio de la " +"empresa)." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__sunday +msgid "Sunday" +msgstr "Domingo" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "The attendance records of your employees will be displayed here." +msgstr "Aquí se mostrarán los registros de asistencia de sus empleados." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__normal +msgid "Weekday" +msgstr "Día de la semana" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "date of the attendance, from the payroll point of view" +msgstr "fecha de la asistencia, desde el punto de vista de la nómina" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "expressed in company timezone" +msgstr "expresado en la zona horaria de la empresa" diff --git a/hr_attendance_hour_type_report/i18n/fr.po b/hr_attendance_hour_type_report/i18n/fr.po new file mode 100644 index 00000000..ba97e74e --- /dev/null +++ b/hr_attendance_hour_type_report/i18n/fr.po @@ -0,0 +1,174 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * dmt_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-10-19 12:25+0000\n" +"PO-Revision-Date: 2022-02-10 16:16+0000\n" +"Last-Translator: ajaniszewska-dev \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_hr_attendance +msgid "Attendance" +msgstr "Présence" + +#. module: hr_attendance_hour_type_report +#: model:ir.actions.act_window,name:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "Attendances for Payroll" +msgstr "Présences pour la Paie" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "Beginning of night work time" +msgstr "Début des heures de nuit" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "Date" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date_type +msgid "Date Type" +msgstr "Type date" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Date type" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_daytime +msgid "Day hours" +msgstr "Heures de jour" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Nom" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +msgid "End of night work time" +msgstr "Fin des heures de nuit" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__id +msgid "ID" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: hr_attendance_hour_type_report +#: code:addons/hr_attendance_hour_type_report/models/hr_attendance.py:0 +#, python-format +msgid "More than 24h of work in 1 shift is forbidden" +msgstr "Il est interdit de travailler plus de 24 heures d'un coup." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_nighttime +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "Night hours" +msgstr "Heures de nuit" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "No attendance records found" +msgstr "Pas de présences trouvées" + +#. module: hr_attendance_hour_type_report +#: model:ir.ui.menu,name:hr_attendance_hour_type_report.menu_hr_attendance_report +msgid "Payroll Report" +msgstr "Rapport de paie" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Payroll date" +msgstr "Jour" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__holiday +msgid "Public Holiday" +msgstr "Férié" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"Set the begining and end of the night work period. This is set in the " +"company's timezone (configured on the partner of the company)." +msgstr "" +"Définissez le début et la fin de la période de travail de nuit. Ceci se fait " +"dans le fuseau horaire de l'entreprise (configuré sur le partenaire de " +"l'entreprise)." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__sunday +msgid "Sunday" +msgstr "Dimanche" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "The attendance records of your employees will be displayed here." +msgstr "Les présences de vos employés seront affichées ici." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__normal +msgid "Weekday" +msgstr "Jour de semaine" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "date of the attendance, from the payroll point of view" +msgstr "Date de présence selon Paie" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "expressed in company timezone" +msgstr "exprimé dans le fuseau horaire de l'entreprise" + +#~ msgid "Invoice section name" +#~ msgstr "Nom de section sur facture" + +#~ msgid "Sales Order" +#~ msgstr "Bon de commande" diff --git a/hr_attendance_hour_type_report/i18n/hr_attendance_hour_type_report.pot b/hr_attendance_hour_type_report/i18n/hr_attendance_hour_type_report.pot new file mode 100644 index 00000000..2c500911 --- /dev/null +++ b/hr_attendance_hour_type_report/i18n/hr_attendance_hour_type_report.pot @@ -0,0 +1,161 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_attendance_hour_type_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_hr_attendance +msgid "Attendance" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.actions.act_window,name:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "Attendances for Payroll" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "Beginning of night work time" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_company +msgid "Companies" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "Date" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date_type +msgid "Date Type" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Date type" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_daytime +msgid "Day hours" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__display_name +msgid "Display Name" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +msgid "End of night work time" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__id +msgid "ID" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: code:addons/hr_attendance_hour_type_report/models/hr_attendance.py:0 +#, python-format +msgid "More than 24h of work in 1 shift is forbidden" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_nighttime +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "Night hours" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "No attendance records found" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.ui.menu,name:hr_attendance_hour_type_report.menu_hr_attendance_report +msgid "Payroll Report" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Payroll date" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__holiday +msgid "Public Holiday" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"Set the begining and end of the night work period. This is set in the " +"company's timezone (configured on the partner of the company)." +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__sunday +msgid "Sunday" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "The attendance records of your employees will be displayed here." +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__normal +msgid "Weekday" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "date of the attendance, from the payroll point of view" +msgstr "" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "expressed in company timezone" +msgstr "" diff --git a/hr_attendance_hour_type_report/i18n/it.po b/hr_attendance_hour_type_report/i18n/it.po new file mode 100644 index 00000000..653be8d7 --- /dev/null +++ b/hr_attendance_hour_type_report/i18n/it.po @@ -0,0 +1,169 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_attendance_hour_type_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-10 18:10+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"" +msgstr "" +"" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_hr_attendance +msgid "Attendance" +msgstr "Presenza" + +#. module: hr_attendance_hour_type_report +#: model:ir.actions.act_window,name:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "Attendances for Payroll" +msgstr "Presenze per libro paga" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "Beginning of night work time" +msgstr "Inizio orario lavorativo notturno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: hr_attendance_hour_type_report +#: model:ir.model,name:hr_attendance_hour_type_report.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "Date" +msgstr "Data" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__date_type +msgid "Date Type" +msgstr "Tipo data" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Date type" +msgstr "Tipo data" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_daytime +msgid "Day hours" +msgstr "Ore giorno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__display_name +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +msgid "End of night work time" +msgstr "Fine orario lavorativo notturno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company__id +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings__id +msgid "ID" +msgstr "ID" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_company____last_update +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: hr_attendance_hour_type_report +#: code:addons/hr_attendance_hour_type_report/models/hr_attendance.py:0 +#, python-format +msgid "More than 24h of work in 1 shift is forbidden" +msgstr "Sono vietate più di 24 ore lavorative in un turno" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,field_description:hr_attendance_hour_type_report.field_hr_attendance__worked_hours_nighttime +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "Night hours" +msgstr "Ore notturne" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "No attendance records found" +msgstr "Nessun record presenza trovato" + +#. module: hr_attendance_hour_type_report +#: model:ir.ui.menu,name:hr_attendance_hour_type_report.menu_hr_attendance_report +msgid "Payroll Report" +msgstr "Resoconto libro paga" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.hr_attendance_search_view +msgid "Payroll date" +msgstr "Data libro paga" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__holiday +msgid "Public Holiday" +msgstr "Giorno festivo" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.ui.view,arch_db:hr_attendance_hour_type_report.res_config_settings_view_form +msgid "" +"Set the begining and end of the night work period. This is set in the " +"company's timezone (configured on the partner of the company)." +msgstr "" +"Impostare l'inizio e la fine del periodo di lavoro notturno. Questo è " +"impostato nel fuso orario dell'azienda (configurato nel partner " +"dell'azienda)." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__sunday +msgid "Sunday" +msgstr "Domenica" + +#. module: hr_attendance_hour_type_report +#: model_terms:ir.actions.act_window,help:hr_attendance_hour_type_report.hr_attendance_report_action +msgid "The attendance records of your employees will be displayed here." +msgstr "I record delle presenze dei dipendenti verranno visualizzati qui." + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields.selection,name:hr_attendance_hour_type_report.selection__hr_attendance__date_type__normal +msgid "Weekday" +msgstr "Giorno della settimana" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_hr_attendance__date +msgid "date of the attendance, from the payroll point of view" +msgstr "data della presenza, dal punto di vista del libro paga" + +#. module: hr_attendance_hour_type_report +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_company__hr_night_work_hour_start +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_end +#: model:ir.model.fields,help:hr_attendance_hour_type_report.field_res_config_settings__hr_night_work_hour_start +msgid "expressed in company timezone" +msgstr "espresso nel fuso orario dell'azienda" diff --git a/hr_attendance_hour_type_report/models/__init__.py b/hr_attendance_hour_type_report/models/__init__.py new file mode 100644 index 00000000..dc2cebca --- /dev/null +++ b/hr_attendance_hour_type_report/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import res_company +from . import res_config +from . import hr_attendance diff --git a/hr_attendance_hour_type_report/models/hr_attendance.py b/hr_attendance_hour_type_report/models/hr_attendance.py new file mode 100644 index 00000000..14efd542 --- /dev/null +++ b/hr_attendance_hour_type_report/models/hr_attendance.py @@ -0,0 +1,116 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import datetime as dt +import logging + +import pytz + +from odoo import _, api, exceptions, fields, models + +_logger = logging.getLogger(__name__) + + +class HrAttendance(models.Model): + _inherit = "hr.attendance" + + worked_hours_nighttime = fields.Float( + string="Night hours", compute="_compute_worked_hours", store=True + ) + worked_hours_daytime = fields.Float( + string="Day hours", + compute="_compute_worked_hours", + store=True, + readonly=True, + ) + date = fields.Date( + string="Date", + help="date of the attendance, from the payroll point of view", + compute="_compute_date", + store=True, + ) + date_type = fields.Selection( + [("normal", "Weekday"), ("sunday", "Sunday"), ("holiday", "Public Holiday")], + compute="_compute_date_type", + store=True, + ) + + @api.depends("date") + def _compute_date_type(self): + for rec in self: + if rec.date.weekday() == 6: + rec.date_type = "sunday" + elif rec.employee_id._get_public_holidays(rec.date, rec.date): + rec.date_type = "holiday" + else: + rec.date_type = "normal" + + @api.depends("check_in") + def _compute_date(self): + UTC = pytz.timezone("utc") + for rec in self: + tz = rec.employee_id.tz + check_in = rec.check_in + if not check_in.tzinfo: + check_in = UTC.localize(check_in) + check_in_tz = check_in.astimezone(pytz.timezone(tz)) + rec.date = check_in_tz.date() + + @api.depends("check_in", "check_out") + def _compute_worked_hours(self): + res = super()._compute_worked_hours() + UTC = pytz.timezone("utc") + for rec in self: + rec.worked_hours_nighttime = 0 + rec.worked_hours_daytime = 0 + if not rec.check_out: + continue + if rec.worked_hours > 24: + raise exceptions.UserError( + _("More than 24h of work in 1 shift is forbidden") + ) + night_start = rec.employee_id.company_id.hr_night_work_hour_start + hour_night_start = int(night_start) + minute_night_start = int(60 * (night_start - hour_night_start)) + night_end = rec.employee_id.company_id.hr_night_work_hour_end + hour_night_end = int(night_end) + minute_night_end = int(60 * (night_end - hour_night_end)) + tz = pytz.timezone(rec.employee_id.tz) + check_in = UTC.localize(rec.check_in) + check_out = UTC.localize(rec.check_out) + curr_day_night_start = tz.localize( + dt.datetime.combine( + rec.date, dt.time(hour=hour_night_start, minute=minute_night_start) + ) + ).astimezone(UTC) + curr_day_night_end = tz.localize( + dt.datetime.combine( + rec.date, dt.time(hour=hour_night_end, minute=minute_night_end) + ) + ).astimezone(UTC) + next_day_night_start = tz.localize( + dt.datetime.combine( + rec.date + dt.timedelta(days=1), + dt.time(hour=hour_night_start, minute=minute_night_start), + ) + ).astimezone(UTC) + next_day_night_end = tz.localize( + dt.datetime.combine( + rec.date + dt.timedelta(days=1), + dt.time(hour=hour_night_end, minute=minute_night_end), + ) + ).astimezone(UTC) + rec.worked_hours_nighttime += ( + min(check_out, curr_day_night_end) - min(curr_day_night_end, check_in) + ).total_seconds() / 3600.0 + if check_out > curr_day_night_start: + rec.worked_hours_nighttime += ( + min(check_out, next_day_night_end) + - max(check_in, curr_day_night_start) + ).total_seconds() / 3600.0 + rec.worked_hours_nighttime += ( + max(check_out, next_day_night_start) - next_day_night_start + ).total_seconds() / 3600.0 + if check_out > next_day_night_start: + _logger.warning("very long_shift for employee %s", rec.employee_id.id) + rec.worked_hours_daytime = rec.worked_hours - rec.worked_hours_nighttime + return res diff --git a/hr_attendance_hour_type_report/models/res_company.py b/hr_attendance_hour_type_report/models/res_company.py new file mode 100644 index 00000000..126c995c --- /dev/null +++ b/hr_attendance_hour_type_report/models/res_company.py @@ -0,0 +1,14 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + hr_night_work_hour_start = fields.Float( + "Beginning of night work time", default=22, help="expressed in company timezone" + ) + hr_night_work_hour_end = fields.Float( + "End of night work time", default=6, help="expressed in company timezone" + ) diff --git a/hr_attendance_hour_type_report/models/res_config.py b/hr_attendance_hour_type_report/models/res_config.py new file mode 100644 index 00000000..2ab09ec1 --- /dev/null +++ b/hr_attendance_hour_type_report/models/res_config.py @@ -0,0 +1,14 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + hr_night_work_hour_start = fields.Float( + related="company_id.hr_night_work_hour_start", readonly=False + ) + hr_night_work_hour_end = fields.Float( + related="company_id.hr_night_work_hour_end", readonly=False + ) diff --git a/hr_attendance_hour_type_report/readme/CONFIGURE.rst b/hr_attendance_hour_type_report/readme/CONFIGURE.rst new file mode 100644 index 00000000..17649ded --- /dev/null +++ b/hr_attendance_hour_type_report/readme/CONFIGURE.rst @@ -0,0 +1,5 @@ +There is a new setting in the Attendance settings to set on the company the +hour at which the night worktime starts and ends. The default is from 10pm to +6am. + +These hours are expressed in the employee's time zone. diff --git a/hr_attendance_hour_type_report/readme/CONTRIBUTORS.rst b/hr_attendance_hour_type_report/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..89ec6f52 --- /dev/null +++ b/hr_attendance_hour_type_report/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Alexandre Fayolle +* Cédric Pigeon diff --git a/hr_attendance_hour_type_report/readme/DESCRIPTION.rst b/hr_attendance_hour_type_report/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ddde8edd --- /dev/null +++ b/hr_attendance_hour_type_report/readme/DESCRIPTION.rst @@ -0,0 +1,9 @@ +This module provides a new report in hr_attendance to display the worked time of employees split in +the following categories: + +* type of day (weekday, sunday, holiday) +* daytime / nighttime + +The information of a day being a holiday comes from the configured public holidays from the module hr_holidays_public. + +This is meant as a helper for people interacting with external payroll systems. diff --git a/hr_attendance_hour_type_report/readme/USAGE.rst b/hr_attendance_hour_type_report/readme/USAGE.rst new file mode 100644 index 00000000..6c0c42fd --- /dev/null +++ b/hr_attendance_hour_type_report/readme/USAGE.rst @@ -0,0 +1,9 @@ +Go to Attendances -> Attendances for Payroll, you will see a list view or a pivot view of attendances with the following values: + +* date (using the check in datetime, converted to the date in the employee's timezone +* date type (normal, sunday or holiday) +* daytime work duration +* nighttime work duration +* total work duration + +The list view and pivot view can be exported to a spreadsheet for further processing. diff --git a/hr_attendance_hour_type_report/static/description/icon.png b/hr_attendance_hour_type_report/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/hr_attendance_hour_type_report/static/description/icon.png differ diff --git a/hr_attendance_hour_type_report/tests/__init__.py b/hr_attendance_hour_type_report/tests/__init__.py new file mode 100644 index 00000000..544dd33f --- /dev/null +++ b/hr_attendance_hour_type_report/tests/__init__.py @@ -0,0 +1 @@ +from . import test_attendance diff --git a/hr_attendance_hour_type_report/tests/test_attendance.py b/hr_attendance_hour_type_report/tests/test_attendance.py new file mode 100644 index 00000000..5f937069 --- /dev/null +++ b/hr_attendance_hour_type_report/tests/test_attendance.py @@ -0,0 +1,109 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import datetime as dt + +from odoo import exceptions + +from odoo.addons.base.tests.common import BaseCommon + + +class TestAttendance(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.employee = cls.env["hr.employee"].create( + { + "name": "TestEmployee", + "tz": "Europe/Paris", + } + ) + # we use the default start and end limits for night work for the company: 22h to 6h + cls.env["resource.calendar.leaves"].create( + { + "name": "Toussaint", + "date_from": dt.datetime(2021, 11, 1), + "date_to": dt.datetime(2021, 11, 1, 23, 59, 59), + } + ) + + def _create_attendance(self, start, end=False): + """create an attendance, start and end are in UTC""" + return self.env["hr.attendance"].create( + { + "employee_id": self.employee.id, + "check_in": start, + "check_out": end, + } + ) + + def test_attendance_date(self): + attendance = self._create_attendance( + "2021-12-02 06:00:00", "2021-12-02 15:00:00" + ) + self.assertEqual(attendance.date, dt.date(2021, 12, 2)) + + def test_attendance_date_with_tz_switch(self): + attendance = self._create_attendance( + "2021-12-02 23:30:00", # this is 2021-12-03 00:30 in Europe/Paris + "2021-12-03 08:00", + ) + self.assertEqual(attendance.date, dt.date(2021, 12, 3)) + + def test_attendance_date_type_normal(self): + attendance = self._create_attendance( + "2021-12-02 06:00:00", "2021-12-02 15:00:00" + ) + self.assertEqual(attendance.date_type, "normal") + + def test_attendance_date_type_sunday(self): + attendance = self._create_attendance( + "2021-12-05 06:00:00", "2021-12-05 15:00:00" + ) + self.assertEqual(attendance.date_type, "sunday") + + def test_attendance_date_type_public_holiday(self): + attendance = self._create_attendance( + "2021-11-01 06:00:00", "2021-11-01 15:00:00" + ) + self.assertEqual(attendance.date_type, "holiday") + + def test_attendance_worktime_no_check_out(self): + attendance = self._create_attendance("2021-12-02 06:00:00") + self.assertEqual(attendance.worked_hours_nighttime, 0.0) + self.assertEqual(attendance.worked_hours_daytime, 0.0) + + def test_attendance_worktime_just_day(self): + attendance = self._create_attendance( + "2021-12-02 06:00:00", "2021-12-02 15:00:00" + ) + self.assertEqual(attendance.worked_hours_nighttime, 0.0) + self.assertEqual(attendance.worked_hours_daytime, 8.0) + + def test_attendance_worktime_start_early(self): + attendance = self._create_attendance( + "2021-12-02 03:00:00", "2021-12-02 12:00:00" + ) + self.assertEqual(attendance.worked_hours_nighttime, 2.0) + self.assertEqual(attendance.worked_hours_daytime, 6.0) + + def test_attendance_worktime_end_late(self): + attendance = self._create_attendance( + "2021-12-02 15:00:00", "2021-12-03 00:00:00" + ) + self.assertEqual(attendance.worked_hours_nighttime, 3.0) + self.assertEqual(attendance.worked_hours_daytime, 6.0) + + def test_attendance_worktime_night_shift(self): + attendance = self._create_attendance( + "2021-12-02 21:00:00", "2021-12-03 06:00:00" + ) + self.assertEqual(attendance.worked_hours_nighttime, 8.0) + self.assertEqual(attendance.worked_hours_daytime, 1.0) + + def test_attendance_worktime_too_long(self): + with self.assertRaises(exceptions.UserError): + self._create_attendance("2021-12-02 20:00:00", "2021-12-03 22:00:00") + # the exception happens when we flush to disk or when we read the + # worked_hours_nighttime/daytime fields, because it is raised by + # the computation of some fields + self.cr.flush() diff --git a/hr_attendance_hour_type_report/views/hr_attendance.xml b/hr_attendance_hour_type_report/views/hr_attendance.xml new file mode 100644 index 00000000..2b96d65e --- /dev/null +++ b/hr_attendance_hour_type_report/views/hr_attendance.xml @@ -0,0 +1,88 @@ + + + + hr.attendance + 30 + + + + + + + + + + + + + + hr.attendance + + + + + + + + + + + + + + + hr.attendance + + + + + + + + + + + + + Attendances for Payroll + hr.attendance + pivot,tree + + + +

+ No attendance records found +

+

+ The attendance records of your employees will be displayed here. +

+
+
+ + + tree + + + + + + pivot + + + + +
diff --git a/hr_attendance_hour_type_report/views/res_config_settings.xml b/hr_attendance_hour_type_report/views/res_config_settings.xml new file mode 100644 index 00000000..08a13832 --- /dev/null +++ b/hr_attendance_hour_type_report/views/res_config_settings.xml @@ -0,0 +1,31 @@ + + + + res.config.settings + + + +

Night hours

+
+
+ + +
+
+ +
+ Set the begining and end of the night work period. This is set in the company's timezone (configured on the partner of the company). +
+
+
+
+
+
+