mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] hr_attendance_work_entry: to Odoo 14.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
'name': 'Attendance Work Entry Type',
|
||||
'description': 'Set work types on attendance records.',
|
||||
'version': '13.0.1.0.0',
|
||||
'version': '14.0.1.0.0',
|
||||
'website': 'https://hibou.io/',
|
||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||
'license': 'AGPL-3',
|
||||
|
||||
@@ -7,7 +7,7 @@ class HrEmployee(models.Model):
|
||||
|
||||
attendance_state = fields.Selection(selection_add=[('break', 'Break'), ('lunch', 'Lunch')])
|
||||
|
||||
@api.depends('last_attendance_id.work_type_id')
|
||||
@api.depends('last_attendance_id.work_type_id', 'last_attendance_id.check_in', 'last_attendance_id.check_out', 'last_attendance_id')
|
||||
def _compute_attendance_state(self):
|
||||
for employee in self:
|
||||
att = employee.last_attendance_id.sudo()
|
||||
|
||||
@@ -44,4 +44,5 @@ class TestAttendanceWorkType(common.TransactionCase):
|
||||
attendance = self.employee._attendance_action_change()
|
||||
self.assertEqual(attendance.work_type_id, self.default_work_type)
|
||||
self.assertEqual(attendance.work_type_id.attendance_state, 'checked_in')
|
||||
self.assertEqual(self.employee.last_attendance_id, attendance)
|
||||
self.assertEqual(self.employee.attendance_state, 'checked_in')
|
||||
|
||||
Reference in New Issue
Block a user