[MERGE] Latest trunk.

bzr revid: vta@openerp.com-20121018120920-dvr8wp8tyhngy601
This commit is contained in:
vta vta@openerp.com 2012-10-18 14:09:20 +02:00
commit fb52618556
2 changed files with 17 additions and 6 deletions

View File

@ -291,6 +291,17 @@ var Events = instance.web.Class.extend({
return this;
},
callbackList: function() {
var lst = [];
_.each(this._callbacks || {}, function(el, eventName) {
var node = el;
while ((node = node.next) && node.next) {
lst.push([eventName, node.callback, node.context]);
}
});
return lst;
},
trigger : function(events) {
var event, node, calls, tail, args, all, rest;
if (!(calls = this._callbacks))
@ -369,9 +380,9 @@ instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, {
event.source.__edispatcherEvents.off(event.name, event.func, self);
});
this.__edispatcherRegisteredEvents = [];
if(!this.__edispatcherEvents) {
debugger;
}
_.each(this.__edispatcherEvents.callbackList(), function(cal) {
this.off(cal[0], cal[2], cal[1]);
}, this);
this.__edispatcherEvents.off();
instance.web.ParentedMixin.destroy.call(this);
}

View File

@ -248,6 +248,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
var remaining = groups.length - 1,
groups_array = [];
return $.when.apply(null, _.map(groups, function (group, index) {
self.do_clear_groups();
var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain());
return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit })
@ -261,14 +262,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
});
}));
});
self.do_clear_groups();
},
do_process_dataset: function() {
var self = this;
this.$el.remove('oe_kanban_grouped').addClass('oe_kanban_ungrouped');
this.$el.removeClass('oe_kanban_grouped').addClass('oe_kanban_ungrouped');
this.add_group_mutex.exec(function() {
var def = $.Deferred();
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).then(function(records) {
self.do_clear_groups();
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
self.do_add_groups([kgroup]).then(function() {
if (_.isEmpty(records)) {
@ -281,7 +282,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
});
return def;
});
self.do_clear_groups();
},
do_reload: function() {
this.do_search(this.search_domain, this.search_context, this.search_group_by);