This question has been flagged

i have a check-in date and a check out date one is "line.date" and other is "attend_id.day".

this is my record i am searching through 

hr_attendance_ids = hr_attendance.search([('employee_id','=',line.employee_id.id), ('day','=',line.date)])

then i am looping through it 


if hr_attendance_ids:
for attend_id in hr_attendance_ids:
if attend_id.day == line.date and attend_id.check_in and not attend_id.check_out:
attend_id.write({'check_out':check_out})
I have used 
attend_id.day > line.date 
but this doesnt work
Avatar
Discard

Your question is not clear. When you will call the above code? did you try to use Logging to see if your code is executed or not.

First add Logging to check if your search return values or not, then you can print attend_id.day and line.date to see if it's returned values.

You can read in below article how to use logging:

https://www.odoo.yenthevg.com/logging-in-odoo/