Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions hr_payroll_attendance_report/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
=========================
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/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%2Fpayroll-lightgray.png?logo=github
:target: https://github.com/OCA/payroll/tree/16.0/hr_payroll_attendance_report
:alt: OCA/payroll
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/payroll-16-0/payroll-16-0-hr_payroll_attendance_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/payroll&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Attendance Control on Payslip

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/payroll/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 <https://github.com/OCA/payroll/issues/new?body=module:%20hr_payroll_attendance_report%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Escodoo

Contributors
~~~~~~~~~~~~

* `Escodoo <https://escodoo.com.br>`_:

* Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>

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/payroll <https://github.com/OCA/payroll/tree/16.0/hr_payroll_attendance_report>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions hr_payroll_attendance_report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2025 - TODAY, Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
18 changes: 18 additions & 0 deletions hr_payroll_attendance_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2025 - TODAY, Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
# 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 ,Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/payroll",
"depends": [
"payroll",
"hr_attendance",
],
"data": [
"report/report_hr_payroll_attendance.xml",
],
"installable": True,
}
61 changes: 61 additions & 0 deletions hr_payroll_attendance_report/i18n/hr_payroll_attendance_report.pot
Original file line number Diff line number Diff line change
@@ -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 "<strong>Total in Period:</strong>"
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 ""
3 changes: 3 additions & 0 deletions hr_payroll_attendance_report/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2025 - TODAY, Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import hr_payslip
30 changes: 30 additions & 0 deletions hr_payroll_attendance_report/models/hr_payslip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2025 - TODAY, Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
# 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)
3 changes: 3 additions & 0 deletions hr_payroll_attendance_report/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions hr_payroll_attendance_report/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Escodoo <https://escodoo.com.br>`_:

* Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
1 change: 1 addition & 0 deletions hr_payroll_attendance_report/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Attendance Control on Payslip
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- # Copyright 2025 - TODAY, Cristiano Mafra Junior <cristiano.mafra@escodoo.com.br>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<template
id="report_hr_payroll_attendance_report"
inherit_id="payroll.report_payslip"
>
<xpath expr="//div[hasclass('page')]" position="inside">
<t t-set="emp_tz" t-value="o.employee_id.tz or user.tz" />
<t t-if="o.attendance_ids">
<h3 style="margin-top: 12px;">Worked Hours</h3>
<table
class="table table-sm o_main_table"
style="font-size:14px; line-height:1.65;"
>
<thead>
<tr>
<th style="padding:2px 4px;">Date</th>
<th style="padding:2px 4px;">Check In</th>
<th style="padding:2px 4px;">Check Out</th>
<th style="padding:2px 4px;" class="text-right">Total</th>
</tr>
</thead>
<tbody>
<t t-foreach="o.attendance_ids" t-as="att">
<tr>
<td style="padding:2px 4px;">
<span
t-if="att.check_in"
t-field="att.check_in"
t-options="{'widget': 'date', 'tz': emp_tz}"
/>
</td>
<td style="padding:2px 4px;">
<span
t-if="att.check_in"
t-field="att.check_in"
t-options="{'widget': 'datetime', 'tz': emp_tz}"
/>
</td>
<td style="padding:2px 4px;">
<span
t-if="att.check_out"
t-field="att.check_out"
t-options="{'widget': 'datetime', 'tz': emp_tz}"
/>
</td>
<td style="padding:2px 4px;" class="text-right">
<span
t-field="att.worked_hours"
t-options="{'widget': 'float_time'}"
/>
</td>
</tr>
</t>
</tbody>
</table>
<div style="margin-top:6px; text-align:right; font-size:18px;">
<strong>Total in Period:</strong>
<span t-field="o.total_worked_hours" t-options="{'widget': 'float_time'}" />
</div>
</t>
</xpath>
</template>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading