summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/data.js
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-08-17 12:17:33 +0200
committerDenis Ledoux <dle@odoo.com>2016-08-17 12:26:16 +0200
commit8787476b50d56ed49d498989a70e6e3460d71376 (patch)
tree6012b6603423ae3f7a6e5f02bc7592853c09062c /addons/web/static/src/js/framework/data.js
parent717ca3390fedc4e56a0bf1e21c4bb8795e76b80c (diff)
[FIX] web: fix DataSetSearch to avoid race conditions
This is a following of revision ab8a93c85268a4d7fc0bef10c0f39fb25d1530c6 This revision solves a new case: when quickly performing a second search after one which has not been resolved yet in a kanban view, and the second search is resolved before the first, it was not possible to load the form by clicking the card of the kanban, it leaded to a `Could not find id in dataset` web client error This was because the ids of the dataset were altered with the ids of the first search (the one that lasted longer), while the records displayed were the ones of the second search (the one that finished first) opw-682362
Diffstat (limited to 'addons/web/static/src/js/framework/data.js')
-rw-r--r--addons/web/static/src/js/framework/data.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js
index 3e9396a4e96..60df888ea1d 100644
--- a/addons/web/static/src/js/framework/data.js
+++ b/addons/web/static/src/js/framework/data.js
@@ -688,7 +688,7 @@ var DataSetSearch = DataSet.extend({
.limit(options.limit || false);
q = q.order_by.apply(q, this._sort);
- return q.all().done(function (records) {
+ return this.orderer.add(q.all()).done(function (records) {
// FIXME: not sure about that one, *could* have discarded count
q.count().done(function (count) { self._length = count; });
self.ids = _(records).pluck('id');