From 486a21d0e4448ce01b2d286a965b31aa8dd14aba Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Fri, 20 May 2022 09:34:58 +0000 Subject: [PATCH] [IMP] web: allow custom onPushState method This helper is tested by the account_accountant module. See legacy view adapter. Task: 2555114 Part-of: odoo/odoo#91448 --- addons/web/static/src/legacy/action_adapters.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/legacy/action_adapters.js b/addons/web/static/src/legacy/action_adapters.js index 1f436dfe1c2..64db441a272 100644 --- a/addons/web/static/src/legacy/action_adapters.js +++ b/addons/web/static/src/legacy/action_adapters.js @@ -117,7 +117,11 @@ class ActionAdapter extends ComponentAdapter { this.wowlEnv.config.setDisplayName(actionTitle); } } - this.router.pushState(query); + if (this.props.onPushState) { + this.props.onPushState(query); + } else { + this.router.pushState(query); + } } _trigger_up(ev) {