[REVERT] revert previous commit which:

1. is wrong
2. break runbot

bzr revid: chs@openerp.com-20131122170316-lbuxddprrgz1are3
This commit is contained in:
Christophe Simonis 2013-11-22 18:03:16 +01:00
parent 3a7c74ca31
commit 1be71fdae6
1 changed files with 13 additions and 28 deletions

View File

@ -501,38 +501,23 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
self.$el.find('.oe_list_record_selector').prop('checked', false);
this.records.reset();
var reloaded = $.Deferred();
setTimeout(function() {
var $group;
try {
$group = self.groups.render(function () {
// NOTE using == instead of === is wanted.
if (self.dataset.index == null) { // jshint ignore:line
if (self.records.length) {
self.dataset.index = 0;
}
} else if (self.dataset.index >= self.records.length) {
this.$el.find('.oe_list_content').append(
this.groups.render(function () {
if (self.dataset.index == null) {
if (self.records.length) {
self.dataset.index = 0;
}
self.compute_aggregates();
});
} finally {
// ensure that the deferred is always rejected/resolved to quit the
// synchronized block properly.
if (_.isUndefined($group)) {
reloaded.reject();
} else {
reloaded.resolve();
self.$el.find('.oe_list_content').append($group);
self.do_push_state({
page: self.page,
limit: self._limit
});
} else if (self.dataset.index >= self.records.length) {
self.dataset.index = 0;
}
}
}, 0);
self.compute_aggregates();
reloaded.resolve();
}));
this.do_push_state({
page: this.page,
limit: this._limit
});
return reloaded.promise();
}),
reload: function () {