[IMP] web: add afterExecuteAction to view_button_hook

The function will be called after the action has been executed.

X-original-commit: 1e4c6e457a9c42da76c647ca0972b06e6d838349
Part-of: odoo/odoo#101310
This commit is contained in:
William Braeckman
2022-09-27 18:14:49 +02:00
parent e854fe7421
commit dc930e8e2a
@@ -39,6 +39,9 @@ export function useViewButtons(model, ref, options = {}) {
(() => {
return true;
});
const afterExecuteAction =
options.afterExecuteAction ||
(() => {});
useSubEnv({
async onClickViewButton({
clickParams,
@@ -97,6 +100,7 @@ export function useViewButtons(model, ref, options = {}) {
error = _e;
await doActionParams.onClose();
}
await afterExecuteAction(clickParams);
enableButtons(getEl(), manuallyDisabledButtons, enableAction);
if (error) {
return Promise.reject(error);