fix
This commit is contained in:
parent
c7a27501c3
commit
056a3b3a87
|
|
@ -438,12 +438,12 @@ class AttendanceController(http.Controller):
|
|||
'employee_id': employee.id,
|
||||
'action': 'sign_out',
|
||||
'action_type': 'auto',
|
||||
'name': fields.datetime.now(),
|
||||
'name': last,
|
||||
'zone': "%s,%s" % (body.get('longitude'), body.get('latitude')),
|
||||
'longitude': body.get('longitude'),
|
||||
'latitude': body.get('latitude'),
|
||||
})
|
||||
msg = _("Auto Checkout successfully")
|
||||
msg = _("Auto Checkout successfully")
|
||||
subject = _("Auto Checkout")
|
||||
self.send_msg(employee, msg, subject)
|
||||
records = employee.attendance_log_ids.sudo().filtered(
|
||||
|
|
@ -451,14 +451,14 @@ class AttendanceController(http.Controller):
|
|||
for r in records:
|
||||
r.old = True
|
||||
employee.message_sent = False
|
||||
return http_helper.response(message="Auto Checkout successfully", data={'status': True})
|
||||
return http_helper.response(message="Auto Checkout successfully", data={'status': True})
|
||||
else:
|
||||
if not employee.message_sent:
|
||||
msg = _("You are out of attendance zone you will be auto sign out")
|
||||
subject = _("Auto Sign out")
|
||||
self.send_msg(employee, msg, subject)
|
||||
employee.message_sent = True
|
||||
return http_helper.response(message="Auto Checkout Fail and Send %s-%s-%s-%s"%(zone.auto_checkout,zone_general.auto_checkout,zone,zone_general), data={'status': False})
|
||||
return http_helper.response(message="Auto Checkout Fail and Send", data={'status': False})
|
||||
else:
|
||||
self.create_log(employee, body.get('longitude'), body.get('latitude'))
|
||||
if not employee.message_sent:
|
||||
|
|
|
|||
Loading…
Reference in New Issue