Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Attendances
Entity: hr.employee
Compute Method: _compute_total_overtime
| Inputs | Method | Outputs |
|---|---|---|
|
|
- mapped_validated_overtimes = dict(self.env['hr.attendance']._read_group( - domain=[('overtime_status', '=', 'approved')], - groupby=['employee_id'], - aggregates=['validated_overtime_hours:sum'] - )) - mapped_overtime_adjustments = dict(self.env['hr.attendance.overtime']._read_group( - domain=[('adjustment', '=', True)], + overtime_by_employee = dict(self.env['hr.attendance']._read_group( + domain=[ + ('employee_id', 'in', self.ids), + ('time_rule_id', '!=', False), + ], groupby=['employee_id'], - aggregates=['duration:sum'] + aggregates=['worked_hours:sum'], )) for employee in self: - employee.total_overtime = mapped_validated_overtimes.get(employee, 0) + mapped_overtime_adjustments.get(employee, 0) + employee.total_overtime = overtime_by_employee.get(employee, 0.0) |
|
