def METHOD_NAME(self, fields_list):
    """This template only works on some context of active record"""
    res = super(ImportXLSXWizard, self).METHOD_NAME(fields_list)
    res_model = self._context.get("active_model", False)
    res_id = self._context.get("active_id", False)
    if not res_model or not res_id:
        return res
    record = self.env[res_model].browse(res_id)
    messages = []
    valid = True
    # For all import, only allow import in draft state (for documents)
    import_states = self._context.get("template_import_states", [])
    if import_states:  # states specified in context, test this
        if "state" in record and record["state"] not in import_states:
            messages.append(_("Document must be in %s states") % import_states)
            valid = False
    else:  # no specific state specified, test with draft
        if "state" in record and "draft" not in record["state"]:  # not in
            messages.append(_("Document must be in draft state"))
            valid = False
    # Context testing
    if self._context.get("template_context", False):
        template_context = self._context["template_context"]
        for key, value in template_context.items():
            if (
                key not in record
                or (
                    record._fields[key].type == "many2one"
                    and record[key].id
                    or record[key]
                )
                != value
            ):
                valid = False
                messages.append(
                    _(
                        "This import action is not usable "
                        "in this document context"
                    )
                )
                break
    if not valid:
        raise ValidationError("\n".join(messages))
    return res