[MERGE] Latest trunk.
bzr revid: vta@openerp.com-20121018120920-dvr8wp8tyhngy601
This commit is contained in:
commit
fb52618556
|
@ -291,6 +291,17 @@ var Events = instance.web.Class.extend({
|
||||||
return this;
|
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) {
|
trigger : function(events) {
|
||||||
var event, node, calls, tail, args, all, rest;
|
var event, node, calls, tail, args, all, rest;
|
||||||
if (!(calls = this._callbacks))
|
if (!(calls = this._callbacks))
|
||||||
|
@ -369,9 +380,9 @@ instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, {
|
||||||
event.source.__edispatcherEvents.off(event.name, event.func, self);
|
event.source.__edispatcherEvents.off(event.name, event.func, self);
|
||||||
});
|
});
|
||||||
this.__edispatcherRegisteredEvents = [];
|
this.__edispatcherRegisteredEvents = [];
|
||||||
if(!this.__edispatcherEvents) {
|
_.each(this.__edispatcherEvents.callbackList(), function(cal) {
|
||||||
debugger;
|
this.off(cal[0], cal[2], cal[1]);
|
||||||
}
|
}, this);
|
||||||
this.__edispatcherEvents.off();
|
this.__edispatcherEvents.off();
|
||||||
instance.web.ParentedMixin.destroy.call(this);
|
instance.web.ParentedMixin.destroy.call(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,6 +248,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
var remaining = groups.length - 1,
|
var remaining = groups.length - 1,
|
||||||
groups_array = [];
|
groups_array = [];
|
||||||
return $.when.apply(null, _.map(groups, function (group, index) {
|
return $.when.apply(null, _.map(groups, function (group, index) {
|
||||||
|
self.do_clear_groups();
|
||||||
var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
|
var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
|
||||||
new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain());
|
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 })
|
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() {
|
do_process_dataset: function() {
|
||||||
var self = this;
|
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() {
|
this.add_group_mutex.exec(function() {
|
||||||
var def = $.Deferred();
|
var def = $.Deferred();
|
||||||
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).then(function(records) {
|
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);
|
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
|
||||||
self.do_add_groups([kgroup]).then(function() {
|
self.do_add_groups([kgroup]).then(function() {
|
||||||
if (_.isEmpty(records)) {
|
if (_.isEmpty(records)) {
|
||||||
|
@ -281,7 +282,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
});
|
});
|
||||||
return def;
|
return def;
|
||||||
});
|
});
|
||||||
self.do_clear_groups();
|
|
||||||
},
|
},
|
||||||
do_reload: function() {
|
do_reload: function() {
|
||||||
this.do_search(this.search_domain, this.search_context, this.search_group_by);
|
this.do_search(this.search_domain, this.search_context, this.search_group_by);
|
||||||
|
|
Loading…
Reference in New Issue