'Select the records in ``self`` such that ``func(rec)`` is true, and
return them as a recordset.
:param func: a function or a dot-separated sequence of field names'

def filtered(self, func):

    if isinstance(func, basestring):
        name = func
        func = (lambda rec: filter(None, rec.mapped(name)))
    return self.browse([rec.id for rec in self if func(rec)])
