From 88d48818c259f44ef1e2c821972cd32b691a5d27 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 24 Oct 2016 16:43:59 +0200 Subject: [FIX] website: correctly define website.error function * The Dialog dependency was missing * The function arguments were wrong --- addons/website/static/src/js/website.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/website/static/src') diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 7a7e8809b31..6606adc4978 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -2,6 +2,7 @@ odoo.define('website.website', function (require) { "use strict"; var ajax = require('web.ajax'); + var Dialog = require("web.Dialog"); var core = require('web.core'); var Widget = require('web.Widget'); var session = require('web.session'); @@ -135,9 +136,9 @@ odoo.define('website.website', function (require) { var error = function (title, message, url) { return new Dialog(null, { - title: data.data ? data.data.arguments[0] : "", + title: title || "", $content: $(qweb.render('website.error_dialog', { - message: data.data ? data.data.arguments[1] : data.statusText, + message: message || "", backend_url: url, })), }).open(); -- cgit v1.2.3 From 389574e550e58a7ac8a7acdb277a2908d223e13e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 24 Oct 2016 17:19:19 +0200 Subject: [FIX] website: make the 'include assets bundle' option of ace editor work Commit which added summernote broke the ace editor with a strange change: https://github.com/odoo/odoo/commit/9069d0127c176317436b67b23ae5677dd9d53de7#diff-e9d66a1b466f404be082fa00519eafa5L140. With this change instead of not including the assets bundles in the ace editor and allowing to see them by checking the option, the assets bundles were included when NOT in debug mode and not included when in debug mode. --- addons/website/static/src/js/website.ace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src') diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index ad39ac92025..2a3f149fbad 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -137,7 +137,7 @@ var args = { key: $(document.documentElement).data('view-xmlid'), full: true, - bundles: !!$('script[src*=".assets_common"]').length + bundles: this.$('.js_include_bundles')[0].checked }; return openerp .jsonRpc('/website/customize_template_get', 'call', args) -- cgit v1.2.3 From eb7226d8d061ecafa523910bf48b1b2649090dd1 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 24 Oct 2016 17:33:38 +0200 Subject: [FIX] website: prevent faulty 'no access' message for analytics There are multiple scopes giving access to analytics api, like https://www.googleapis.com/auth/analytics.readonly Having a space at the end of the queried string prevents correct scope detection; so a user who has, in fact, access will receive a faulty error message. --- addons/website/static/src/js/website.backendDashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src') diff --git a/addons/website/static/src/js/website.backendDashboard.js b/addons/website/static/src/js/website.backendDashboard.js index ed241fd2215..35b27340c5f 100644 --- a/addons/website/static/src/js/website.backendDashboard.js +++ b/addons/website/static/src/js/website.backendDashboard.js @@ -257,7 +257,7 @@ var Dashboard = Widget.extend(ControlPanelMixin, { // Check if the user is authenticated and has the right to make API calls if (!gapi.analytics.auth.getAuthResponse()) { this.display_unauthorized_message($analytics_components, 'not_connected'); - } else if (gapi.analytics.auth.getAuthResponse() && gapi.analytics.auth.getAuthResponse().scope.indexOf('https://www.googleapis.com/auth/analytics ') === -1) { + } else if (gapi.analytics.auth.getAuthResponse() && gapi.analytics.auth.getAuthResponse().scope.indexOf('https://www.googleapis.com/auth/analytics') === -1) { this.display_unauthorized_message($analytics_components, 'no_right'); } else { this.make_analytics_calls($analytics_components); -- cgit v1.2.3