diff options
| author | Swapnesh Shah <swapneshshah111@gmail.com> | 2020-05-18 18:17:40 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2021-04-28 14:55:19 +0000 |
| commit | c462782f66d720266e7e8e7f616fc26c23f009c8 (patch) | |
| tree | d7f4fd317414e4e37dab09695b5f70096d3a7be5 /addons/hr_attendance | |
| parent | 702d2b317df00626fcfbc70c80b7885cbc034f1d (diff) | |
[FIX] hr_attendance: compute worked hours when needed
Steps to reproduce the bug:
- Go to Attendances > Manager > Attendances
- Remove Check in value of an hr.attendance record A
- Set Check out to A
Bug:
A traceback was raised
opw:2513143
closes odoo/odoo#70041
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons/hr_attendance')
| -rw-r--r-- | addons/hr_attendance/models/hr_attendance.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py index 9ba0b61df62..5e91d90b886 100644 --- a/addons/hr_attendance/models/hr_attendance.py +++ b/addons/hr_attendance/models/hr_attendance.py @@ -39,7 +39,7 @@ class HrAttendance(models.Model): @api.depends('check_in', 'check_out') def _compute_worked_hours(self): for attendance in self: - if attendance.check_out: + if attendance.check_out and attendance.check_in: delta = attendance.check_out - attendance.check_in attendance.worked_hours = delta.total_seconds() / 3600.0 else: |
