[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.
This commit is contained in:
@@ -1611,6 +1611,7 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('reset', this.proxy('clear_selection'));
|
.on('reset', this.proxy('clear_selection'));
|
||||||
|
if (!this.action_id) return $.when();
|
||||||
return this.model.call('get_filters', [this.target_model, this.action_id])
|
return this.model.call('get_filters', [this.target_model, this.action_id])
|
||||||
.done(this.proxy('prepare_dropdown_menu'));
|
.done(this.proxy('prepare_dropdown_menu'));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -699,6 +699,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||||||
var self = this;
|
var self = this;
|
||||||
if (!this.action_manager) return;
|
if (!this.action_manager) return;
|
||||||
var breadcrumbs = this.action_manager.get_breadcrumbs();
|
var breadcrumbs = this.action_manager.get_breadcrumbs();
|
||||||
|
if (!breadcrumbs.length) return;
|
||||||
var $breadcrumbs = _.map(_.initial(breadcrumbs), function (bc) {
|
var $breadcrumbs = _.map(_.initial(breadcrumbs), function (bc) {
|
||||||
var $link = $('<a>').text(bc.title);
|
var $link = $('<a>').text(bc.title);
|
||||||
$link.click(function () {
|
$link.click(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user