From d8d71c5ce67be6a450cd68c01a703d578ef74fd5 Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Thu, 7 Sep 2023 13:56:30 +0200 Subject: [PATCH] [FIX] website: fix traceback when refreshing with f5 or ctrl+r [1] removed the `router.redirect` method but [2] which was forward ported after from 16.0 used the redirect method where it still existed. This causes a traceback when using f5 or ctrl+r. This commit fixes that by using the proper method in 16.2+ [1]: https://github.com/odoo/odoo/commit/365fe390fdc814bc079419f0bd940b8edd652618 [2]: https://github.com/odoo/odoo/commit/45affc3a94f33478063d2e82be5e0c51df92fb5f task-3458691 closes odoo/odoo#134764 X-original-commit: dec96bca556b8df23fb692587cb64b47a6a3206b Signed-off-by: Romain Derie (rde) --- .../src/client_actions/website_preview/website_preview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/client_actions/website_preview/website_preview.js b/addons/website/static/src/client_actions/website_preview/website_preview.js index 60baf28b6ee..dc0480db641 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview.js +++ b/addons/website/static/src/client_actions/website_preview/website_preview.js @@ -498,8 +498,8 @@ export class WebsitePreview extends Component { } ev.preventDefault(); const path = this.websiteService.contentWindow.location; - const debugMode = this.env.debug ? `?debug=${odoo.debug}` : ""; - this.router.redirect( + const debugMode = this.env.debug ? `?debug=${this.env.debug}` : ""; + browser.location.assign( `/web${debugMode}#action=website.website_preview&path=${encodeURIComponent(path)}` ); }