diff options
| author | qdp-odoo <qdp@odoo.com> | 2016-03-16 10:27:19 +0100 |
|---|---|---|
| committer | qdp-odoo <qdp@odoo.com> | 2016-03-16 10:27:19 +0100 |
| commit | 7a3d63b377c730a3052adc960fa2681cd9be37e3 (patch) | |
| tree | 2f9300531b73c484a62f62ba1d85cd6f4e2c9b39 /addons/web/static/src/js/framework | |
| parent | 9067addbab9dc32002a243f3b48f2e76d23a3373 (diff) | |
| parent | 71d16a369e01515aac988c62371d70549d3b5294 (diff) | |
[MERGE] forward port of branch saas-7 up to revision 71d16a369e01515aac988c62371d70549d3b5294
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/data.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js index e92bbd98c53..a1b8e1602e9 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -833,9 +833,10 @@ var BufferedDataSet = DataSetStatic.extend({ }); } this.delete_all = false; - _.each(_.clone(this.running_reads), function(el) { - el.reject(); - }); + this.cancel_read(); + }, + cancel_read: function () { + _.invoke(_.clone(this.running_reads), 'reject'); }, read_ids: function (ids, fields, options) { // read what is necessary from the server to have ids and the given @@ -897,11 +898,8 @@ var BufferedDataSet = DataSetStatic.extend({ }); var _super = this._super; this.mutex.exec(function () { - _super.call(self, to_get, fields, options).then(function() { - def.resolve.apply(def, arguments); - }, function() { - def.reject.apply(def, arguments); - }); + if (def.state() !== "pending") return; + _super.call(self, to_get, fields, options).then(_.bind(def.resolve, def), _.bind(def.reject, def)); return def; }); return def.then(function(records) { @@ -942,11 +940,11 @@ var BufferedDataSet = DataSetStatic.extend({ this.evict_record(id); return this._super(id, signal); }, - alter_ids: function(n_ids) { + alter_ids: function(n_ids, options) { var dirty = !_.isEqual(this.ids, n_ids); - this._super(n_ids); + this._super(n_ids, options); if (dirty) { - this.trigger("dataset_changed", n_ids); + this.trigger("dataset_changed", n_ids, options); } }, }); |
