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] [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 b0d8e8abd..fd40218cb 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 e4a6ab6a3..8034557db 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