summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2013-11-22 18:03:16 +0100
committerChristophe Simonis <chs@openerp.com>2013-11-22 18:03:16 +0100
commit1be71fdae6d01169b50dff6f3eb7657a98436dce (patch)
treeb188852d1a9f8e12321e6dd0d23bdded521d5717 /addons/web/static/src
parent3a7c74ca31e3719592677162672a5010ab9a8fbc (diff)
[REVERT] revert previous commit which:
1. is wrong 2. break runbot bzr revid: chs@openerp.com-20131122170316-lbuxddprrgz1are3
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_list.js41
1 files changed, 13 insertions, 28 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index 868a218f70e..b9c789cb6a9 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -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 () {