Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Created April 11, 2025 23:28
Show Gist options
  • Save ofelix03/42fc5df63a706560ca2c2f7e52268932 to your computer and use it in GitHub Desktop.
Save ofelix03/42fc5df63a706560ca2c2f7e52268932 to your computer and use it in GitHub Desktop.
FormSaveReasonDialog
import {patch} from "@web/core/utils/patch";
import {FormController} from "@web/views/form/form_controller";
import {useService} from "@web/core/utils/hooks";
// import our custom dialog component
import {FormSaveReasonDialog} from "../../../custom_dialog/customer_dialog";
patch(FormController.prototype, {
setup() {
super.setup();
this.dialogService = useService("dialog");
},
async save(params)
const res = super.save(params);
// pass custom dialog component, plus props to the dialog service
this.dialogService.add(FormSaveReasonDialog, {
getPayload: (payload) => {
const {reason} = payload;
},
});;
return res
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment