Skip to content

Commit

Permalink
[IMP] web: Add hook 'onWillStartAfterLoad' on useModel
Browse files Browse the repository at this point in the history
Allow a custom onWillStart but after the loading of the model in useModel.

Task: 3193121
Part-of: odoo#119185
  • Loading branch information
smetl committed Jun 23, 2023
1 parent c6b4f67 commit e7cbd26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/web/static/src/views/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e7cbd26

Please sign in to comment.