def METHOD_NAME(self, document_number):
    self.ensure_one()
    is_invalid_number = True
    # TODO Improve this implementation!
    invalids = self.env["l10n_br_fiscal.invalidate.number"].search(
        [("state", "=", "done"), ("document_serie_id", "=", self.id)]
    )
    invalid_numbers = []
    for invalid in invalids:
        invalid_numbers += range(invalid.number_start, invalid.number_end + 1)
    if int(document_number) not in invalid_numbers:
        is_invalid_number = False
    return is_invalid_number