diff --git a/hr_attendance_report_theoretical_time/README.rst b/hr_attendance_report_theoretical_time/README.rst index 1cd56cc2..094c4f99 100644 --- a/hr_attendance_report_theoretical_time/README.rst +++ b/hr_attendance_report_theoretical_time/README.rst @@ -149,6 +149,7 @@ Contributors - Pedro M. Baeza. - David Vidal - Víctor Martínez + - Juan José Seguí - Pedro Gonzalez - Aritz Olea diff --git a/hr_attendance_report_theoretical_time/__manifest__.py b/hr_attendance_report_theoretical_time/__manifest__.py index edeca2df..17fb7bd1 100644 --- a/hr_attendance_report_theoretical_time/__manifest__.py +++ b/hr_attendance_report_theoretical_time/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Theoretical vs Attended Time Analysis", - "version": "16.0.1.1.0", + "version": "17.0.1.0.0", "category": "Human Resources", "website": "https://github.com/OCA/hr-attendance", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/hr_attendance_report_theoretical_time/models/hr_attendance.py b/hr_attendance_report_theoretical_time/models/hr_attendance.py index 8bdf9fb3..31f8861c 100644 --- a/hr_attendance_report_theoretical_time/models/hr_attendance.py +++ b/hr_attendance_report_theoretical_time/models/hr_attendance.py @@ -18,3 +18,12 @@ def _compute_theoretical_hours(self): record.theoretical_hours = obj._theoretical_hours( record.employee_id, record.check_in ) + + @api.model + def _select(self): + return super()._select() + """, hra.theoretical_hours""" + + @api.model + def _from(self): + res = super()._from() + return res.replace("worked_hours", "worked_hours, theoretical_hours") diff --git a/hr_attendance_report_theoretical_time/readme/CONTRIBUTORS.md b/hr_attendance_report_theoretical_time/readme/CONTRIBUTORS.md index cc058652..3cb73665 100644 --- a/hr_attendance_report_theoretical_time/readme/CONTRIBUTORS.md +++ b/hr_attendance_report_theoretical_time/readme/CONTRIBUTORS.md @@ -2,6 +2,7 @@ - Pedro M. Baeza. - David Vidal - Víctor Martínez + - Juan José Seguí - Pedro Gonzalez \<\> - Aritz Olea \<\> - [Trobz](https://trobz.com): diff --git a/hr_attendance_report_theoretical_time/reports/__init__.py b/hr_attendance_report_theoretical_time/reports/__init__.py index 62fd7d71..ca76ed84 100644 --- a/hr_attendance_report_theoretical_time/reports/__init__.py +++ b/hr_attendance_report_theoretical_time/reports/__init__.py @@ -1,4 +1,3 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import hr_attendance_report from . import hr_attendance_theoretical_time_report diff --git a/hr_attendance_report_theoretical_time/reports/hr_attendance_report.py b/hr_attendance_report_theoretical_time/reports/hr_attendance_report.py deleted file mode 100644 index 401d0283..00000000 --- a/hr_attendance_report_theoretical_time/reports/hr_attendance_report.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2022 Tecnativa - Víctor Martínez -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import api, fields, models - - -class HRAttendanceReport(models.Model): - _inherit = "hr.attendance.report" - - theoretical_hours = fields.Float(readonly=True) - - @api.model - def _select(self): - return super()._select() + """, hra.theoretical_hours""" - - @api.model - def _from(self): - res = super()._from() - return res.replace("worked_hours", "worked_hours, theoretical_hours") diff --git a/hr_attendance_report_theoretical_time/reports/hr_attendance_report_views.xml b/hr_attendance_report_theoretical_time/reports/hr_attendance_report_views.xml index 3d15a778..dd64c64c 100644 --- a/hr_attendance_report_theoretical_time/reports/hr_attendance_report_views.xml +++ b/hr_attendance_report_theoretical_time/reports/hr_attendance_report_views.xml @@ -6,8 +6,8 @@ hr.attendance.pivot - Don't show "Theoretical hours" measure - hr.attendance.report - + hr.attendance + 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 34b3a1b3..b0d8e8ab 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 @@ -206,7 +206,7 @@ def read_group( This technique has proven to be more efficient than trying to call recursively `read_group` grouping by date and employee. """ - res = super(HrAttendanceTheoreticalTimeReport, self).read_group( + res = super().read_group( domain, fields, groupby, 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 4c28e67f..6b53b661 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 @@ -39,7 +39,7 @@ hr.attendance.theoretical.time.report - + @@ -67,11 +67,15 @@ name="context" >{'search_default_previous_month': 1, 'search_default_current_month': 1, 'search_default_my': 1} pivot,graph + - +