From 8e65b57df796860a008270d8b425711d2bf88888 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Tue, 6 Sep 2016 15:00:51 +0200 Subject: [FIX] web, web-kanban: update dataset size at record's drop in a column When we drag and drop a record in a folded column, the number of elements in this column displayed in the column title is not updated. This issue is present because when a record is droped in a column its id is not added to the dataset of its new column. To fix this, we had to add the id of the record in the dataset, and override the method 'add_ids' in 'DataSetSearch' to have the size of the dataset equal to the number of ids in it. We have replicated the behaviour of the function 'remove_ids' in the new function 'add_ids'. --- addons/web/static/src/js/framework/data.js | 7 +++++++ 1 file changed, 7 insertions(+) (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 60df888ea1d..7287070013a 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -710,6 +710,13 @@ var DataSetSearch = DataSet.extend({ this._length -= (before - this.ids.length); } }, + add_ids: function(ids, at) { + var before = this.ids.length; + this._super(ids, at); + if(this._length){ + this._length += (this.ids.length - before); + } + }, unlink: function(ids, callback, error_callback) { var self = this; return this._super(ids).done(function() { -- cgit v1.2.3