'Gives virtual event ids for recurring events. This method gives ids of dates
that comes between start date and end date of calendar views
:param order:   The fields (comma separated, format "FIELD {DESC|ASC}") on which
the events should be sorted'

@api.multi
def get_recurrent_ids(self, domain, order=None):

    if order:
        order_fields = [field.split()[0] for field in order.split(',')]
    else:
        order_fields = [field.split()[0] for field in self._order.split(',')]
    if ('id' not in order_fields):
        order_fields.append('id')
    result_data = []
    result = []
    for meeting in self:
        if ((not meeting.recurrency) or (not meeting.rrule)):
            result.append(meeting.id)
            result_data.append(meeting.get_search_fields(order_fields))
            continue
        rdates = meeting._get_recurrent_dates_by_event()
        for (r_start_date, r_stop_date) in rdates:
            pile = []
            ok = True
            r_date = r_start_date
            for arg in domain:
                if (str(arg[0]) in ('start', 'stop', 'final_date')):
                    if (str(arg[0]) == 'start'):
                        r_date = r_start_date
                    else:
                        r_date = r_stop_date
                    if (arg[2] and (len(arg[2]) > len(r_date.strftime(DEFAULT_SERVER_DATE_FORMAT)))):
                        dformat = DEFAULT_SERVER_DATETIME_FORMAT
                    else:
                        dformat = DEFAULT_SERVER_DATE_FORMAT
                    if (arg[1] == '='):
                        ok = (r_date.strftime(dformat) == arg[2])
                    if (arg[1] == '>'):
                        ok = (r_date.strftime(dformat) > arg[2])
                    if (arg[1] == '<'):
                        ok = (r_date.strftime(dformat) < arg[2])
                    if (arg[1] == '>='):
                        ok = (r_date.strftime(dformat) >= arg[2])
                    if (arg[1] == '<='):
                        ok = (r_date.strftime(dformat) <= arg[2])
                    if (arg[1] == '!='):
                        ok = (r_date.strftime(dformat) != arg[2])
                    pile.append(ok)
                elif ((str(arg) == str('&')) or (str(arg) == str('|'))):
                    pile.append(arg)
                else:
                    pile.append(True)
            pile.reverse()
            new_pile = []
            for item in pile:
                if (not isinstance(item, basestring)):
                    res = item
                elif (str(item) == str('&')):
                    first = new_pile.pop()
                    second = new_pile.pop()
                    res = (first and second)
                elif (str(item) == str('|')):
                    first = new_pile.pop()
                    second = new_pile.pop()
                    res = (first or second)
                new_pile.append(res)
            if [True for item in new_pile if (not item)]:
                continue
            result_data.append(meeting.get_search_fields(order_fields, r_date=r_start_date))
    if order_fields:
        uniq = (lambda it: collections.OrderedDict(((id(x), x) for x in it)).values())
        def comparer(left, right):
            for (fn, mult) in comparers:
                result = cmp(fn(left), fn(right))
                if result:
                    return (mult * result)
            return 0
        sort_params = [(key.split()[0] if (key[(-4):].lower() != 'desc') else ('-%s' % key.split()[0])) for key in (order or self._order).split(',')]
        sort_params = uniq([(comp if (comp not in ['start', 'start_date', 'start_datetime']) else 'sort_start') for comp in sort_params])
        sort_params = uniq([(comp if (comp not in ['-start', '-start_date', '-start_datetime']) else '-sort_start') for comp in sort_params])
        comparers = [((itemgetter(col[1:]), (-1)) if (col[0] == '-') else (itemgetter(col), 1)) for col in sort_params]
        ids = [r['id'] for r in sorted(result_data, cmp=comparer)]
    return ids
