Ensure sequential order of on_change calls

It is expected that the on_change_with calls are done using the result values
from the prior on_change calls.

issue7433
review50361002
This commit is contained in:
Cédric Krier committed 2018-05-17 18:26:10 +02:00
1 parent 5f7b567785
commit 79cbde2ad6
1 file changed
+7 -6
+7 -6
View File
@@ -1411,12 +1411,13 @@
record._changed[this.name] = true;
},
changed: function(record) {
var prms = [];
prms.push(record.on_change([this.name]));
prms.push(record.on_change_with([this.name]));
prms.push(record.autocomplete_with(this.name));
record.set_field_context();
return jQuery.when.apply(jQuery, prms);
return record.on_change([this.name]).then(function() {
return record.on_change_with([this.name]).then(function() {
return record.autocomplete_with(this.name).then(function() {
record.set_field_context();
});
}.bind(this));
}.bind(this));
},
get_timestamp: function(record) {
return {};