summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/content/website_root.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
committerChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
commitd74b4518052066446e2a1975a91ce53c745ca75a (patch)
treec08180f88a512d15e37fbec628931f02b3825f65 /addons/website/static/src/js/content/website_root.js
parentec162dd0cb5622ab6e56db1a63dab5f531a96f4a (diff)
parentf4105eb9c7010f8693e5d2fd20c0bd9d9cc2e483 (diff)
[MERGE] forward port branch 13.0 up to f4105eb9c70
Diffstat (limited to 'addons/website/static/src/js/content/website_root.js')
-rw-r--r--addons/website/static/src/js/content/website_root.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js
index a8e208f1408..8c27fb5736e 100644
--- a/addons/website/static/src/js/content/website_root.js
+++ b/addons/website/static/src/js/content/website_root.js
@@ -170,7 +170,7 @@ var WebsiteRoot = publicRootData.PublicRoot.extend({
+ '<br/>'
+ _.str.sprintf(
_t('It might be possible to edit the relevant items or fix the issue in <a href="%s">the classic Odoo interface</a>'),
- '/web#return_label=Website&model=' + $data.data('object') + '&id=' + $data.data('id')
+ '/web#model=' + $data.data('object') + '&id=' + $data.data('id')
),
}),
}).open();
@@ -181,21 +181,14 @@ var WebsiteRoot = publicRootData.PublicRoot.extend({
* @param {Event} ev
*/
_onWebsiteSwitch: function (ev) {
- var websiteID = ev.currentTarget.getAttribute('website-id');
-
- // need to force in each case, even if domain is set
- // Website 1: localhost; Website 2: 0.0.0.0; website 3: -
- // when you switch 3 <--> 1, you need to force the website
-
+ var websiteId = ev.currentTarget.getAttribute('website-id');
var websiteDomain = ev.currentTarget.getAttribute('domain');
- var url = $.param.querystring(window.location.href, {fw: websiteID});
+ var url = window.location.href;
if (websiteDomain && window.location.hostname !== websiteDomain) {
- // if domain unchanged, this line will do a nop while we need to refresh
- // the page to load the new forced website.
- url = new URL(url);
- url.hostname = websiteDomain;
+ var path = window.location.pathname + window.location.search + window.location.hash;
+ url = websiteDomain + path;
}
- window.location.href = url;
+ window.location.href = $.param.querystring(url, {'fw': websiteId});
},
/**
* @private