/** @odoo-module **/

import FormController from "@web/views/form/form_controller";
import { registry } from "@web/core/registry";
import { WebClient } from "@web/webclient/webclient"
import {patch} from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";
patch(WebClient.prototype, {
    async _onButtonClicked(event) {
        const actionService = useService("action");
        if (event.target.classList.contains("prevent_save")) {
            // Prevent the default form submission
            event.preventDefault();
            // Perform your custom action
            actionService.doAction({
                type: 'ir.actions.act_window',
                name: 'Your Wizard Name',
                res_model: 'your.wizard.model',
                views: [[false, 'form']],
                target: 'new',
                context: this.env.context,
            });
            return false;
        }
        return super._onButtonClicked(event);
    },
});
