[FIX]Refixed the issue of kanban view, show more button, which was giving an error of id, here added an id if the id is not available in dataset.

bzr revid: msh@tinyerp.com-20120608073516-v0wa94fuiy9jysec
This commit is contained in:
msh-openerp
2012-06-08 13:05:16 +05:30
parent 365c2a60d3
commit c6c1daf28d
+3 -3
View File
@@ -305,7 +305,6 @@ openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({
this.$records = null;
this.records = [];
this.ids = [];
this.$has_been_started.then(function() {
self.do_add_records(records);
});
@@ -348,9 +347,7 @@ openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({
var rec = new openerp.web_kanban.KanbanRecord(self, record);
rec.insertBefore(self.$records.find('.oe_kanban_show_more'));
self.records.push(rec);
self.ids.push(rec.id);
});
this.view.dataset.ids = _.union(this.view.dataset.ids, self.ids);
this.$records.find('.oe_kanban_show_more').toggle(this.records.length < this.dataset.size())
.find('.oe_kanban_remaining').text(this.dataset.size() - this.records.length);
},
@@ -392,6 +389,9 @@ openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({
},
set_record: function(record) {
this.id = record.id;
if(!(this.id in this.view.dataset.ids)){
this.view.dataset.ids.push(this.id)
}
this.record = this.transform_record(record);
},
start: function() {