From 02f0f3c972500e58fa4d2735722b696a3759aa33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 7 Sep 2019 23:22:12 +0200 Subject: [PATCH] Wait written and parent reload promises before calling display issue8623 review265921016 --- src/screen.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/screen.js b/src/screen.js index bdf7501661..0f4a77308b 100644 --- a/src/screen.js +++ b/src/screen.js @@ -1764,13 +1764,16 @@ }, reload: function(ids, written) { this.group.reload(ids); + var promises = []; if (written) { - this.group.written(ids); + promises.push(this.group.written(ids)); } if (this.group.parent) { - this.group.parent.root_parent.reload(); + promises.push(this.group.parent.root_parent.reload()); } - return this.display(); + return jQuery.when.apply(jQuery, promises).then(function() { + this.display(); + }.bind(this)); }, get_buttons: function() { var selected_records = this.current_view.selected_records;