'Search for some alarms in the interval of time determined by some parameters (after, in_the_next_X_seconds, ...)
:param one_date: date of the event to check (not the same that in the event browse if recurrent)
:param event: Event browse record
:param event_maxdelta: biggest duration from alarms for this event
:param in_the_next_X_seconds: looking in the future (in seconds)
:param after: if not False: will return alert if after this date (date as string - todo: change in master)
:param missing: if not False: will return alert even if we are too late
:param notif: Looking for type notification
:param mail: looking for type email'

def do_check_alarm_for_one_date(self, one_date, event, event_maxdelta, in_the_next_X_seconds, alarm_type, after=False, missing=False):

    result = []
    if ((one_date - timedelta(minutes=((missing and 0) or event_maxdelta))) < (datetime.now() + timedelta(seconds=in_the_next_X_seconds))):
        for alarm in event.alarm_ids:
            if ((alarm.type == alarm_type) and ((one_date - timedelta(minutes=((missing and 0) or alarm.duration_minutes))) < (datetime.now() + timedelta(seconds=in_the_next_X_seconds))) and ((not after) or ((one_date - timedelta(minutes=alarm.duration_minutes)) > fields.Datetime.from_string(after)))):
                alert = {'alarm_id': alarm.id, 'event_id': event.id, 'notify_at': (one_date - timedelta(minutes=alarm.duration_minutes))}
                result.append(alert)
    return result
