summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/data.js
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2016-09-06 15:00:51 +0200
committerPierre Masereel <pim@odoo.com>2016-09-06 17:15:44 +0200
commit8e65b57df796860a008270d8b425711d2bf88888 (patch)
treebba7cdd4ba4332698576f805ba66be82662c159d /addons/web/static/src/js/framework/data.js
parent826ee793847364510160e8e464246d448273bb98 (diff)
[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'.
Diffstat (limited to 'addons/web/static/src/js/framework/data.js')
-rw-r--r--addons/web/static/src/js/framework/data.js7
1 files changed, 7 insertions, 0 deletions
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() {