diff --git a/addons/website/static/src/systray_items/new_content.js b/addons/website/static/src/systray_items/new_content.js index efebce9df6b..dd0066e8665 100644 --- a/addons/website/static/src/systray_items/new_content.js +++ b/addons/website/static/src/systray_items/new_content.js @@ -170,10 +170,14 @@ export class NewContentModal extends Component { if (redirectUrl) { window.location.replace(redirectUrl); } else { - const { id, metadata: { path } } = this.website.currentWebsite; + const { id, metadata: { path, viewXmlid } } = this.website.currentWebsite; + const url = new URL(path); + if (viewXmlid === 'website.page_404') { + url.pathname = ''; + } // A reload is needed after installing a new module, to instantiate // a NewContentModal with patches from the installed module. - window.location.replace(`/web#action=website.website_preview&website_id=${id}&path=${encodeURIComponent(path)}&display_new_content=true`); + window.location.replace(`/web#action=website.website_preview&website_id=${id}&path=${encodeURIComponent(url.toString())}&display_new_content=true`); } }