Repository
OCA/hr-attendance · module folder · Try on Runboat
Module version
1.0.0
Category
Human Resources
Folder size
0.2 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/hr-attendance
Last tracking update
2026-08-07 09:06:27
Authors
Odoo Community Association (OCA), Tecnativa
Maintainers
Odoo Community Association (OCA), Tecnativa
Committers
Víctor Martínez, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
openupgradelib
System dependencies
None
Required by
None
Description
This module adds a new report called "Theoretical vs Attended Time
Analysis" that compares worked time, measured through attendances
records, with the theoretical time, computed from employee's working
calendar, public holidays and employee specific leaves. Missing
attendance days are generated on the fly in the report with their
corresponding theoretical hours.

There is the possibility of counting as theoretical time some leave
types if specified in them.

As an example, imagine a work week with 40 theoretical hours, and these
attendance situation:

- Monday: Worked 10 hours
- Tuesday: Worked 10 hours
- Wednesday: Worked 10 hours
- Thursday: Worked 10 hours
- Friday: Ask for a compensation leave (said leave type), as already
  worked 40 hours.

On the report, whole week should put 40 theoretical hours - 8 per day -
against 40 worked hours (although they were on previous days, and none
on Friday).

On contrary, if you want to take a holiday one of that days, you should
ask for a leave type without the check for counting as theoretical time,
and then the whole week will be 32 theoretical hours against the worked
hours of that week without the leave.

Code Analysis

Views touched (8)
XML IDNameModelTypeStatus
edit_holiday_status_form hr.leave.type form Inherits hr_holidays.edit_holiday_status_form
hr_attendance_theoretical_view_filter hr.attendance.theoretical.time.report search New
hr_attendance_theoretical_view_graph hr.attendance.theoretical.time.report graph New
hr_attendance_theoretical_view_pivot hr.attendance.theoretical.time.report pivot New
hr_attendance_view_pivot hr.attendance.pivot - Don't show "Theoretical hours" measure hr.attendance pivot Inherits hr_attendance.hr_attendance_view_pivot
recompute_theoretical_attendance_form recompute.theoretical.attendance form New
view_employee_form_inherit_hr_attendance hr.employee form Inherits hr.view_employee_form
wizard_theoretical_time_form_view wizard.theoretical.time.form (in hr_attendance_report_theoretical_time) wizard.theoretical.time form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (10)

New fields (0)

No new fields.

Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
    Trigger recomputation for the date of the new lines.
  • write(self, vals)
    If the date of a line is changed, we first recompute hours of the previous date, and then the theoretical hours of the current date.

New fields (2)
  • active Boolean
    default=True
  • theoretical_hours Float
    compute='_compute_theoretical_hours' compute_sudo=True store=True
Public methods (1)
  • action_create_empty_attendance(self, limit_date_from=False, limit_date_to=False)
    Method for creating inactive attendance records with a duration of 0. The goal is to prevent the report from having to calculate data directly, so employee attendance records are created for past days when they should have clocked in.

New fields (7)
  • company_id Many2one
    related='employee_id.company_id'
  • date Date
    readonly=True
  • department_id Many2one → hr.department
    comodel_name='hr.department' readonly=True related='employee_id.department_id' string='Department'
  • difference Float
    readonly=True
  • employee_id Many2one → hr.employee
    comodel_name='hr.employee' readonly=True string='Employee'
  • theoretical_hours Float
    readonly=True string='Theoric'
  • worked_hours Float
    readonly=True string='Worked'
Public methods (1)
  • init(self)

New fields (1)
  • theoretical_hours_start_date Date
    help='Fill this field for setting a manual start date for computing the theoretical hours independently from the attendances. If not filled, employee creation date or the calendar start date will be used (the greatest of both).'
Public methods (0)

No public methods.

New fields (1)
  • theoretical_hours_start_date Date
    help='Fill this field for setting a manual start date for computing the theoretical hours independently from the attendances. If not filled, employee creation date or the calendar start date will be used (the greatest of both).'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • include_in_theoretical Boolean
    help="If you check this mark, leaves in this category won't reduce the number of theoretical hours in the attendance report." string='Include in theoretical hours'
Public methods (0)

No public methods.

New fields (3)
  • date_from Datetime
    help='Recompute attendances from this date' required=True string='From'
  • date_to Datetime
    help='Recompute attendances up to this date' required=True string='To'
  • employee_ids Many2many → hr.employee
    comodel_name='hr.employee' help='Recompute these employees attendances' required=True string='Employees'
Public methods (1)
  • action_recompute(self)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (3)
  • category_ids Many2many → hr.employee.category
    comodel_name='hr.employee.category' string='Tag'
  • department_id Many2one → hr.department
    comodel_name='hr.department' string='Department'
  • employee_ids Many2many → hr.employee
    comodel_name='hr.employee' string='Employees'
Public methods (3)
  • default_get(self, fields)
    @api.model
  • populate(self)
  • view_report(self)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…