Merge pull request #3413 from expsa/younes_dev_odex25_mobile
Display first and second shift attendance information in the app via …
This commit is contained in:
commit
ba40187902
|
|
@ -260,6 +260,9 @@ class AttendanceController(http.Controller):
|
|||
return http_helper.response(code=400, message=_("You are not allowed to perform this operation. please check with one of your team admins"), success=False)
|
||||
if not body.get('date'):
|
||||
return http_helper.response(code=400, message=_("Enter Date First"), success=False)
|
||||
sequence = 1
|
||||
if body.get('sequence'):
|
||||
sequence = int(body.get('sequence'))
|
||||
employee = http.request.env['hr.employee'].search([('user_id', '=', user.id)], limit=1)
|
||||
if not employee:
|
||||
return http_helper.response(code=400, message=_("You are not allowed to perform this operation. please check with one of your team admins"), success=False)
|
||||
|
|
@ -274,7 +277,7 @@ class AttendanceController(http.Controller):
|
|||
month_end = now
|
||||
try:
|
||||
records = http.request.env['hr.attendance.transaction'].sudo().search([('employee_id', '=', employee.id),
|
||||
('date', '>=', str(month_start)), ('date', '<=', str(month_end)),('sequence','=',1)])
|
||||
('date', '>=', str(month_start)), ('date', '<=', str(month_end)),('sequence','=',sequence)])
|
||||
# records = http.request.env['hr.attendance.transaction'].search([('employee_id','=',employee.id),
|
||||
# ('normal_leave', '=', True),('public_holiday', '=', True), ('is_absent','=',True),('date', '>=', str(month_start)), ('date', '<=', str(month_end))])
|
||||
li = []
|
||||
|
|
@ -314,6 +317,7 @@ class AttendanceController(http.Controller):
|
|||
for rec in records:
|
||||
attendance = {
|
||||
'id':rec.id,
|
||||
'sequence':rec.sequence,
|
||||
'date':str(rec.date),
|
||||
'tr_date':self.get_translation_field(rec, 'date'),
|
||||
'first_check_in':self.convert_float_2time(rec.sign_in),
|
||||
|
|
|
|||
Loading…
Reference in New Issue