[FIX] website: fix opening shared documents from the WebsitePreview

Before this commit, following this flow:
- From the documents app, click on the "share" icon of a document,
- In the website builder, in edit mode, paste the link in the link
tools,
- Save and click on the link,
=> There is a traceback coming from cross-origins errors with the iframe.

These documents should be opened in the top window, as it does not make
sense to open the pdf viewer inside the iframe. This is defined in the
website module, to avoid creating a website_documents module just to
patch the WebsitePreview._isTopWindowURL method.

[1]: 44da4bf

task-2687506

closes odoo/odoo#107860

X-original-commit: 2e8fce06cbe4e2d24dd80eca1c59a9d44d181d30
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This commit is contained in:
Younn Olivier
2022-12-15 13:40:48 +01:00
parent 19dfff16c7
commit be47acac64
@@ -283,7 +283,10 @@ export class WebsitePreview extends Component {
|| (pathname
&& (backendRoutes.includes(pathname)
|| pathname.startsWith('/@/')
|| pathname.startsWith('/web/content/')));
|| pathname.startsWith('/web/content/')
// This is defined here to avoid creating a
// website_documents module for just one patch.
|| pathname.startsWith('/document/share/')));
}
/**