[FIX] web_kanban: duplicated tags on load more

When clicking on 'load more', the kanban view only needs to add tags
for new records displayed by load more ; the existing records already
have their tags so one duplicates them.
This commit is contained in:
Martin Geubelle
2016-01-19 14:28:09 +01:00
parent e0ea7c04f9
commit 667909ae4a
@@ -550,11 +550,11 @@ var KanbanView = View.extend({
dataset.read_ids(_.uniq(rel.ids), ['name', 'color']).done(function(result) {
result.forEach(function(record) {
// Does not display the tag if color = 0
if (record['color']){
if (record.color){
var $tag = $('<span>')
.addClass('o_tag o_tag_color_' + record['color'])
.attr('title', _.str.escapeHTML(record['name']));
$(rel.elements[record['id']]).append($tag);
.addClass('o_tag o_tag_color_' + record.color)
.attr('title', _.str.escapeHTML(record.name));
$(rel.elements[record.id]).append($tag);
}
});
// we use boostrap tooltips for better and faster display
@@ -718,7 +718,7 @@ var KanbanView = View.extend({
column.offset += self.limit;
column.remaining = Math.max(column.remaining - self.limit, 0);
column.update_column();
self.postprocess_m2m_tags(column.records);
self.postprocess_m2m_tags(column.records.slice(column.offset));
});
},