summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/data.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-03-24 16:53:45 +0100
committerChristophe Simonis <chs@odoo.com>2016-03-24 16:53:45 +0100
commitddb0fb273982399f7618a017eeb81d6a5253575a (patch)
treef62aea4a3888d45e8bfe0f17baeb4ab9d0b47f41 /addons/web/static/src/js/framework/data.js
parentd8137d35b7cc30df258fc310074eca3bfd88ec7a (diff)
parent59d3f63c58b47dfc1991494f167216cc1d9a9469 (diff)
[MERGE] forward port of branch saas-9 up to 59d3f63
Diffstat (limited to 'addons/web/static/src/js/framework/data.js')
-rw-r--r--addons/web/static/src/js/framework/data.js20
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);
}
},
});