summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/utils.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-10-15 10:33:56 +0000
committerfw-bot <otis@odoo.com>2019-10-15 12:55:04 +0000
commitb2a403efc7796d77b42162483e6f1030de96153f (patch)
tree0c7b3a22dc01d00f6573f37a377a1485de2a916d /addons/website/static/src/js/utils.js
parent93834a55e6f7dcc0507a8e3c1b0c5df32d8d3105 (diff)
[FIX] website_blog: make latest posts snippet multi-website aware
The snippet was using the posts of all websites and blog post creation was suggesting all blogs. Now: - On blog post creation only suggest the blogs of the current website - In latest posts option, only suggest blogs of the current website - In any case, latest posts only displays posts of the current website Part of https://github.com/odoo/odoo/pull/38510 Related to task-2083198 closes odoo/odoo#38794 X-original-commit: 4be97b48861a6631fe465054c62baea65bfc1524 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/js/utils.js')
-rw-r--r--addons/website/static/src/js/utils.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/website/static/src/js/utils.js b/addons/website/static/src/js/utils.js
index a78a914e7a5..d8e69e3eba4 100644
--- a/addons/website/static/src/js/utils.js
+++ b/addons/website/static/src/js/utils.js
@@ -184,10 +184,21 @@ function prompt(options, _qweb) {
return def;
}
+function websiteDomain(self) {
+ var websiteID;
+ self.trigger_up('context_get', {
+ callback: function (ctx) {
+ websiteID = ctx['website_id'];
+ },
+ });
+ return ['|', ['website_id', '=', false], ['website_id', '=', websiteID]];
+}
+
return {
loadAnchors: loadAnchors,
autocompleteWithPages: autocompleteWithPages,
onceAllImagesLoaded: onceAllImagesLoaded,
prompt: prompt,
+ websiteDomain: websiteDomain,
};
});