'Filter the records that satisfy the precondition of action ``self``.'

def _filter_pre(self, records):

    if (self.filter_pre_id and records):
        domain = ([('id', 'in', records.ids)] + safe_eval(self.filter_pre_id.domain, self._get_eval_context()))
        ctx = safe_eval(self.filter_pre_id.context)
        return records.with_context(**ctx).search(domain).with_env(records.env)
    elif (self.filter_pre_domain and records):
        domain = ([('id', 'in', records.ids)] + safe_eval(self.filter_pre_domain, self._get_eval_context()))
        return records.search(domain)
    else:
        return records
