From c1af5edd614f9b881984f384c71313388811be26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 22 Oct 2024 14:35:36 +0200 Subject: [PATCH 1/2] [IMP] hr_attendance_report_theoretical_time: Add Active employees filter to report TT51401 --- .../reports/hr_attendance_theoretical_time_report_views.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report_views.xml b/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report_views.xml index bf05989e..866e7ea1 100644 --- a/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report_views.xml +++ b/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report_views.xml @@ -33,6 +33,12 @@ string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" /> + + From fe619a6ec6e869e702d5797e3fad7f093b59bebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 22 Oct 2024 14:31:29 +0200 Subject: [PATCH 2/2] [IMP] hr_attendance_report_theoretical_time: Add company compatibility in the report If only one company is selected, only the data of the employees of that company should be displayed. TT51401 --- .../reports/hr_attendance_theoretical_time_report.py | 1 + .../hr_attendance_report_theoretical_time_security.xml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report.py b/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report.py index b0d8e8ab..fd40218c 100644 --- a/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report.py +++ b/hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report.py @@ -20,6 +20,7 @@ class HrAttendanceTheoreticalTimeReport(models.Model): employee_id = fields.Many2one( comodel_name="hr.employee", string="Employee", readonly=True ) + company_id = fields.Many2one(related="employee_id.company_id") department_id = fields.Many2one( comodel_name="hr.department", string="Department", diff --git a/hr_attendance_report_theoretical_time/security/hr_attendance_report_theoretical_time_security.xml b/hr_attendance_report_theoretical_time/security/hr_attendance_report_theoretical_time_security.xml index e4a6ab6a..8034557d 100644 --- a/hr_attendance_report_theoretical_time/security/hr_attendance_report_theoretical_time_security.xml +++ b/hr_attendance_report_theoretical_time/security/hr_attendance_report_theoretical_time_security.xml @@ -2,6 +2,11 @@ + + Theoretical vs worked hours multi-company + + [('company_id', 'in', company_ids)] + Theoretical vs worked hours: Own attendances