changeset 6d772f3b0cef in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=6d772f3b0cef
description:
        Wait written and parent reload promises before calling display

        issue8623
        review265921016
diffstat:

 src/screen.js |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 5ff28a22c428 -r 6d772f3b0cef src/screen.js
--- a/src/screen.js     Sat Sep 07 23:20:50 2019 +0200
+++ b/src/screen.js     Sat Sep 07 23:22:12 2019 +0200
@@ -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;

Reply via email to