Skip to content
Health
80/100
good
  • Security25/25
    No findings
  • Activity25/25
    Last human commit 2 months ago
  • Required by5/25
    0 modules depend on it
  • Maturity25/25
    In 10 Odoo series since 10.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
0
Modules depending on it
External deps
1 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.22 MB
Module directory on disk
Code analysis 2 migration notes 10 models 8 views 0 HTTP endpoints

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.

Dependencies

Odoo dependencies
Python dependencies
openupgradelib
System dependencies
None
Required by
None

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

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 (3)
  • active Boolean
    default=True
  • leave_hours Float
    compute='_compute_leave_hours' compute_sudo=True store=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 (8)
  • 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'
  • leave_hours Float
    readonly=True string='Leave'
  • 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 (1)
  • write(self, vals)

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 (2)
  • include_in_leave_theoretical Boolean
    help="If you check this mark, leaves in this category won't reduce the number of leave hours in the attendance report." string='Include in leave hours'
  • 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' context={'active_test': False} 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…