[FIX] hr_attendance: check in with blank pin
When writing a blank pin, the user logged can check in his own related employee. opw:703744
This commit is contained in:
@@ -74,7 +74,7 @@ class HrEmployee(models.Model):
|
||||
@api.multi
|
||||
def attendance_manual(self, next_action, entered_pin=None):
|
||||
self.ensure_one()
|
||||
if entered_pin or self.env['res.users'].browse(SUPERUSER_ID).has_group('hr_attendance.group_hr_attendance_use_pin') and (self.user_id and self.user_id.id != self._uid or not self.user_id):
|
||||
if not (entered_pin is None) or self.env['res.users'].browse(SUPERUSER_ID).has_group('hr_attendance.group_hr_attendance_use_pin') and (self.user_id and self.user_id.id != self._uid or not self.user_id):
|
||||
if entered_pin != self.pin:
|
||||
return {'warning': _('Wrong PIN')}
|
||||
return self.attendance_action(next_action)
|
||||
|
||||
Reference in New Issue
Block a user