def METHOD_NAME(self) -> ES_Q:
    filters = deepcopy(self.filters)
    award_type_filter = filters.pop("award_type", None)
    filters["nonzero_fields"] = self.nonzero_fields
    if filters.get("def_codes"):
        filters["nested_def_codes"] = filters.pop("def_codes")
    filter_query = QueryWithFilters.generate_accounts_elasticsearch_query(filters)
    if award_type_filter:
        is_procurement = award_type_filter == "procurement"
        exists_query = ES_Q("exists", field="financial_accounts_by_award.piid")
        nested_query = ES_Q(
            "nested",
            path="financial_accounts_by_award",
            query=ES_Q("bool", **{f"must{'' if is_procurement else '_not'}": exists_query}),
        )
        filter_query.must.append(nested_query)
    return filter_query