[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:
Goffin Simon
2017-01-11 14:02:05 +01:00
parent 5bd8f97fa2
commit 2db449a2ae
+1 -1
View File
@@ -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)