Do not load missing view in Window Form and call search_filter after the switch from super

This prevent a race condition which may lead to the screen loading twice the
first view.

Partially included in changeset 970f9bc0a89b

issue7660
review52451002
This commit is contained in:
Cédric Krier committed 2018-09-02 10:54:52 +02:00
1 parent f3796ec776
commit 0d545bd4d4
1 file changed
+3 -3
+3 -3
View File
@@ -509,14 +509,14 @@
mode: ['tree', 'form'],
context: context,
});
screen.switch_view().done(function() {
screen.search_filter();
});
var title = record.rec_name().then(function(rec_name) {
return Sao.i18n.gettext('Notes (%1)', rec_name);
});
Sao.Window.Note._super.init.call(this, screen, this.callback,
{view_type: 'tree', title: title});
this.switch_prm = this.switch_prm.then(function() {
return screen.search_filter();
});
},
callback: function(result) {
var prm = jQuery.when();