'Return the recordset ``self`` ordered by ``key``.
:param key: either a function of one argument that returns a
comparison key for each record, or a field name, or ``None``, in
which case records are ordered according the default model\'s order
:param reverse: if ``True``, return the result in reverse order'

def sorted(self, key=None, reverse=False):

    if (key is None):
        recs = self.search([('id', 'in', self.ids)])
        return (self.browse(reversed(recs._ids)) if reverse else recs)
    if isinstance(key, basestring):
        key = itemgetter(key)
    return self.browse(map(attrgetter('id'), sorted(self, key=key, reverse=reverse)))
