summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2014-11-20 12:09:39 +0100
committerGéry Debongnie <ged@odoo.com>2014-11-20 13:22:02 +0100
commit5cd78b891b4baab60de5b55de88385ced11366ff (patch)
treed0e0fa3f630f17d435cdeef810732985a57b03d4 /addons/web/static/src/js
parentd3eac8c85bf00969958307b4801727b4e4e0bade (diff)
[FIX] web client fix: crash when loading translation
Problem happens when the user from the website tries to load a translation, it opens up a modal window without an action. But the modal has a (hidden) searchview which tries to load custom filters corresponding to that non-existing action. Another problem at the same time was that the view manager could not display the breadcrumbs for a non-existing breadcrumb.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/search.js1
-rw-r--r--addons/web/static/src/js/views.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index d2fe8072f40..c4627efc605 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -1611,6 +1611,7 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
}
})
.on('reset', this.proxy('clear_selection'));
+ if (!this.action_id) return $.when();
return this.model.call('get_filters', [this.target_model, this.action_id])
.done(this.proxy('prepare_dropdown_menu'));
},
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index f9d336b52f7..1c41b043bf4 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -699,6 +699,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
var self = this;
if (!this.action_manager) return;
var breadcrumbs = this.action_manager.get_breadcrumbs();
+ if (!breadcrumbs.length) return;
var $breadcrumbs = _.map(_.initial(breadcrumbs), function (bc) {
var $link = $('<a>').text(bc.title);
$link.click(function () {