[FIX] web: prevent crash after searchview is destroyed

The method view_loaded could be called after the searchview was
destroyed, which is not really a good idea.  As a side effect, this
fixes a crash when a form view with a one2many switch to edit view, then
discards the changes.
This commit is contained in:
Géry Debongnie
2015-02-11 12:17:01 +01:00
parent 8e0e2c0e47
commit 8d34ada282
+1 -1
View File
@@ -410,7 +410,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.$('.oe_searchview_unfold_drawer')
.toggleClass('fa-caret-down', !this.visible_filters)
.toggleClass('fa-caret-up', this.visible_filters);
return this.alive($.when(this._super(), load_view.then(this.view_loaded.bind(this))));
return this.alive($.when(this._super(), this.alive(load_view).then(this.view_loaded.bind(this))));
},
view_loaded: function (r) {
var self = this;