From e7cbd26b08fccfc311b423131a7f2dad2b39271b Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Fri, 16 Jun 2023 07:39:37 +0000 Subject: [PATCH] [IMP] web: Add hook 'onWillStartAfterLoad' on useModel Allow a custom onWillStart but after the loading of the model in useModel. Task: 3193121 Part-of: odoo/odoo#119185 --- addons/web/static/src/views/model.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/views/model.js b/addons/web/static/src/views/model.js index 4ab1d6703b8..40d95d2c25d 100644 --- a/addons/web/static/src/views/model.js +++ b/addons/web/static/src/views/model.js @@ -145,6 +145,9 @@ export function useModel(ModelClass, params, options = {}) { await options.onWillStart(); } await load(component.props); + if (options.onWillStartAfterLoad) { + await options.onWillStartAfterLoad(); + } started = true; }); onWillUpdateProps((nextProps) => {