From 0d545bd4d4f64b811742ad2ae85c3f4b4a32dd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 2 Sep 2018 10:54:52 +0200 Subject: [PATCH] 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 --- src/window.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.js b/src/window.js index a69cba8360..434fda40d1 100644 --- a/src/window.js +++ b/src/window.js @@ -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();