From 8787476b50d56ed49d498989a70e6e3460d71376 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 17 Aug 2016 12:17:33 +0200 Subject: [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 --- addons/web/static/src/js/framework/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/framework/data.js') 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'); -- cgit v1.2.3