def METHOD_NAME(self):
    self.ensure_one()
    if self.access_token:
        raise UserError(
            _("You already have ANAF access token. Please revolke it first.")
        )
    return_url = "/l10n_ro_account_anaf_sync/redirect_anaf/%s" % self.id
    return {
        "type": "ir.actions.act_url",
        "url": "%s" % return_url,
        "target": "new",
    }