diff --git a/hr_payroll_attendance_report/README.rst b/hr_payroll_attendance_report/README.rst new file mode 100644 index 0000000..fae90a3 --- /dev/null +++ b/hr_payroll_attendance_report/README.rst @@ -0,0 +1,66 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================= +Payroll Attendance Report +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:feeb4c350afe5ddb6efb4be0891f8a31c814abb0f3aa92d9b67b4c19476314ca + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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-Escodoo%2Fprojet--addons-lightgray.png?logo=github + :target: https://github.com/Escodoo/projet-addons/tree/16.0/hr_payroll_attendance_report + :alt: Escodoo/projet-addons + +|badge1| |badge2| |badge3| + +Projet - Controle de Presença no Holerite + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* `Escodoo `_: + + * Cristiano Mafra Junior + +Maintainers +~~~~~~~~~~~ + +This module is part of the `Escodoo/projet-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/hr_payroll_attendance_report/__init__.py b/hr_payroll_attendance_report/__init__.py new file mode 100644 index 0000000..ed65565 --- /dev/null +++ b/hr_payroll_attendance_report/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2025 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import models diff --git a/hr_payroll_attendance_report/__manifest__.py b/hr_payroll_attendance_report/__manifest__.py new file mode 100644 index 0000000..88d1d82 --- /dev/null +++ b/hr_payroll_attendance_report/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2025 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Payroll Attendance Report", + "summary": "Payslip Attendance on Report", + "version": "16.0.1.0.0", + "author": "Escodoo", + "license": "AGPL-3", + "website": "https://github.com/Escodoo/projet-addons", + "depends": [ + "payroll", + "hr_attendance", + ], + "data": [ + "report/report_hr_payroll_attendance.xml", + ], + "installable": True, +} diff --git a/hr_payroll_attendance_report/i18n/hr_payroll_attendance_report.pot b/hr_payroll_attendance_report/i18n/hr_payroll_attendance_report.pot new file mode 100644 index 0000000..f038126 --- /dev/null +++ b/hr_payroll_attendance_report/i18n/hr_payroll_attendance_report.pot @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_attendance_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-09-24 12:54+0000\n" +"PO-Revision-Date: 2025-09-24 12:54+0000\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_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Total in Period:" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model:ir.model.fields,field_description:hr_payroll_attendance_report.field_hr_payslip__attendance_ids +msgid "Attendance" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Check In" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Check Out" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Date" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model:ir.model,name:hr_payroll_attendance_report.model_hr_payslip +msgid "Payslip" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Total" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model:ir.model.fields,field_description:hr_payroll_attendance_report.field_hr_payslip__total_worked_hours +msgid "Total Worked Hours" +msgstr "" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Worked Hours" +msgstr "" diff --git a/hr_payroll_attendance_report/i18n/pt_BR.po b/hr_payroll_attendance_report/i18n/pt_BR.po new file mode 100644 index 0000000..26aa2fd --- /dev/null +++ b/hr_payroll_attendance_report/i18n/pt_BR.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_payroll_attendance_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-09-24 12:55+0000\n" +"PO-Revision-Date: 2025-09-24 12:55+0000\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_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Total in Period:" +msgstr "Total no Período:" + +#. module: hr_payroll_attendance_report +#: model:ir.model.fields,field_description:hr_payroll_attendance_report.field_hr_payslip__attendance_ids +msgid "Attendance" +msgstr "Presenças" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Check In" +msgstr "Entrada" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Check Out" +msgstr "Saída" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Date" +msgstr "Data" + +#. module: hr_payroll_attendance_report +#: model:ir.model,name:hr_payroll_attendance_report.model_hr_payslip +msgid "Payslip" +msgstr "Holerite" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Total" +msgstr "Total" + +#. module: hr_payroll_attendance_report +#: model:ir.model.fields,field_description:hr_payroll_attendance_report.field_hr_payslip__total_worked_hours +msgid "Total Worked Hours" +msgstr "Total de Horas Trabalhadas" + +#. module: hr_payroll_attendance_report +#: model_terms:ir.ui.view,arch_db:hr_payroll_attendance_report.report_hr_payroll_attendance_report +msgid "Worked Hours" +msgstr "Horas Trabalhadas" diff --git a/hr_payroll_attendance_report/models/__init__.py b/hr_payroll_attendance_report/models/__init__.py new file mode 100644 index 0000000..47c74fb --- /dev/null +++ b/hr_payroll_attendance_report/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2025 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import hr_payslip diff --git a/hr_payroll_attendance_report/models/hr_payslip.py b/hr_payroll_attendance_report/models/hr_payslip.py new file mode 100644 index 0000000..622be45 --- /dev/null +++ b/hr_payroll_attendance_report/models/hr_payslip.py @@ -0,0 +1,30 @@ +# Copyright 2025 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class HrPayslip(models.Model): + _inherit = "hr.payslip" + + attendance_ids = fields.One2many( + comodel_name="hr.attendance", + compute="_compute_attendance_ids", + ) + total_worked_hours = fields.Float( + compute="_compute_attendance_ids", + ) + + @api.depends("date_from", "date_to", "employee_id") + def _compute_attendance_ids(self): + for slip in self: + attendances = self.env["hr.attendance"].search( + [ + ("employee_id", "=", slip.employee_id.id), + ("check_in", ">=", slip.date_from), + ("check_in", "<=", slip.date_to), + ], + order="check_in ASC", + ) + slip.attendance_ids = attendances + slip.total_worked_hours = sum(att.worked_hours for att in attendances) diff --git a/hr_payroll_attendance_report/pyproject.toml b/hr_payroll_attendance_report/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/hr_payroll_attendance_report/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_payroll_attendance_report/readme/CONTRIBUTORS.rst b/hr_payroll_attendance_report/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..418948a --- /dev/null +++ b/hr_payroll_attendance_report/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Escodoo `_: + + * Cristiano Mafra Junior diff --git a/hr_payroll_attendance_report/readme/DESCRIPTION.rst b/hr_payroll_attendance_report/readme/DESCRIPTION.rst new file mode 100644 index 0000000..8cc3fd9 --- /dev/null +++ b/hr_payroll_attendance_report/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Projet - Controle de Presença no Holerite diff --git a/hr_payroll_attendance_report/report/report_hr_payroll_attendance.xml b/hr_payroll_attendance_report/report/report_hr_payroll_attendance.xml new file mode 100644 index 0000000..36028d2 --- /dev/null +++ b/hr_payroll_attendance_report/report/report_hr_payroll_attendance.xml @@ -0,0 +1,66 @@ + + + + + diff --git a/hr_payroll_attendance_report/static/description/icon.png b/hr_payroll_attendance_report/static/description/icon.png new file mode 100644 index 0000000..12ab005 Binary files /dev/null and b/hr_payroll_attendance_report/static/description/icon.png differ diff --git a/hr_payroll_attendance_report/static/description/index.html b/hr_payroll_attendance_report/static/description/index.html new file mode 100644 index 0000000..5f1b2d3 --- /dev/null +++ b/hr_payroll_attendance_report/static/description/index.html @@ -0,0 +1,422 @@ + + + + + +README.rst + + + +
+ + +Odoo Community Association +
+

Payroll Attendance Report

+ +

Beta License: AGPL-3 Escodoo/projet-addons

+

Projet - Controle de Presença no Holerite

+

Table of contents

+ +
+

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

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the Escodoo/projet-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+
+ +