changeset 6cfb4a009f64 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=6cfb4a009f64
description:
        Do not expect promise from Record.set

        Since issue8482, Record.set does not return a promise anymore.

        issue8585
        review264081002
diffstat:

 src/model.js  |   4 +---
 src/window.js |  13 +++++--------
 2 files changed, 6 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r 9760dffbf2fc -r 6cfb4a009f64 src/model.js
--- a/src/model.js      Sun Aug 18 18:57:29 2019 +0200
+++ b/src/model.js      Thu Aug 22 22:44:38 2019 +0200
@@ -702,7 +702,6 @@
             var succeed = function(values, exception) {
                 if (exception === undefined) exception = false;
                 var id2value = {};
-                var promises = [];
                 values.forEach(function(e, i, a) {
                     id2value[e.id] = e;
                 });
@@ -722,10 +721,9 @@
                             }
                             delete value[key];
                         }
-                        promises.push(record.set(value));
+                        record.set(value);
                     }
                 }
-                return jQuery.when.apply(jQuery, promises);
             }.bind(this);
             var failed = function() {
                 var failed_values = [];
diff -r 9760dffbf2fc -r 6cfb4a009f64 src/window.js
--- a/src/window.js     Sun Aug 18 18:57:29 2019 +0200
+++ b/src/window.js     Thu Aug 22 22:44:38 2019 +0200
@@ -734,17 +734,14 @@
                 }.bind(this));
             };
             var set_preferences = function(preferences) {
-                var prm;
                 this.screen.current_record.cancel();
-                prm = this.screen.current_record.set(preferences);
+                this.screen.current_record.set(preferences);
                 this.screen.current_record.id =
                     this.screen.model.session.user_id;
-                prm.then(function() {
-                    this.screen.current_record.validate(null, true).then(
-                        function() {
-                            this.screen.display(true);
-                        }.bind(this));
-                }.bind(this));
+                this.screen.current_record.validate(null, true).then(
+                    function() {
+                        this.screen.display(true);
+                    }.bind(this));
                 dialog.body.append(this.screen.screen_container.el);
                 this.el.modal('show');
             };

Reply via email to