'Checks the attendance records of the timesheet, make sure they are all closed
(by making sure they have a check_out time)'

@api.multi
def check_employee_attendance_state(self):

    self.ensure_one()
    if any(self.attendances_ids.filtered((lambda r: (not r.check_out)))):
        raise UserError(_('The    timesheet    cannot    be    validated    as    it    contains    an    attendance    record    with    no    Check    Out).'))
    return True
