diff --git a/addons/web/static/src/webclient/actions/action_service.js b/addons/web/static/src/webclient/actions/action_service.js index 1a690d1cc72..882c258631e 100644 --- a/addons/web/static/src/webclient/actions/action_service.js +++ b/addons/web/static/src/webclient/actions/action_service.js @@ -971,10 +971,21 @@ function makeActionManager(env) { report_url: _getReportUrl(action, "html"), context: Object.assign({}, action.context), }); - const clientActionOptions = Object.assign({}, options, { - props, + + const controller = { + jsId: `controller_${++id}`, + // for historical reasons, the report Component is a client action, + // but there's no need to keep this when it will be converted to owl. + Component: actionRegistry.get("report.client_action"), + action, + ..._getActionInfo(action, props), + }; + + return _updateUI(controller, { + clearBreadcrumbs: options.clearBreadcrumbs, + stackPosition: options.stackPosition, + onClose: options.onClose, }); - return doAction("report.client_action", clientActionOptions); } /** diff --git a/addons/web/static/tests/webclient/actions/report_action_tests.js b/addons/web/static/tests/webclient/actions/report_action_tests.js index b996a8077c1..cc4d38bd7c0 100644 --- a/addons/web/static/tests/webclient/actions/report_action_tests.js +++ b/addons/web/static/tests/webclient/actions/report_action_tests.js @@ -354,4 +354,24 @@ QUnit.module("ActionManager", (hooks) => { assert.verifySteps(["/report/check_wkhtmltopdf", "/report/download"]); testUtils.mock.unpatch(ReportClientAction); }); + + QUnit.test("url is valid", async (assert) => { + assert.expect(2); + + patchWithCleanup(ReportClientAction.prototype, { + init() { + this._super(...arguments); + this.report_url = "about:blank"; + }, + }); + + const webClient = await createWebClient({ serverData }); + + await doAction(webClient, 12); // 12 is a html report action in serverData + + const hash = webClient.router.current.hash; + // used to put report.client_action in the url + assert.strictEqual(hash.action === "report.client_action", false); + assert.strictEqual(hash.action === 12, true); + }); });