[REV] xmo@openerp.com-20110824131606-yokgoe3dz9ltaz2l, has nothing to do with the issue and does not actually fix it (just fudges some timing so it happens slightly less often)

bzr revid: xmo@openerp.com-20110825081833-a1vbcdm59mrzf2d0
This commit is contained in:
Xavier Morel 2011-08-25 10:18:33 +02:00
parent c8bb3c1ea5
commit de955d0983
1 changed files with 9 additions and 9 deletions

View File

@ -120,7 +120,7 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi
*/ */
start: function() { start: function() {
this.$element.addClass('oe-listview'); this.$element.addClass('oe-listview');
return this.reload_view(); return this.reload_view(null, null, true);
}, },
/** /**
* Called after loading the list view's description, sets up such things * Called after loading the list view's description, sets up such things
@ -362,22 +362,22 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi
* @param {Boolean} [grouped] Should the list be displayed grouped * @param {Boolean} [grouped] Should the list be displayed grouped
* @param {Object} [context] context to send the server while loading the view * @param {Object} [context] context to send the server while loading the view
*/ */
reload_view: function (grouped, context) { reload_view: function (grouped, context, initial) {
var self = this, d = $.Deferred(); var self = this;
d.then(function (field_view_get) { var callback = function (field_view_get) {
console.log('loaded', initial ? 'initial' : 'subsequent');
self.on_loaded(field_view_get, grouped); self.on_loaded(field_view_get, grouped);
}); };
if (this.embedded_view) { if (this.embedded_view) {
d.resolve({fields_view: this.embedded_view}); return $.Deferred().then(callback).resolve({fields_view: this.embedded_view});
} else { } else {
this.rpc('/base/listview/load', { return this.rpc('/base/listview/load', {
model: this.model, model: this.model,
view_id: this.view_id, view_id: this.view_id,
context: this.dataset.get_context(context), context: this.dataset.get_context(context),
toolbar: this.options.sidebar toolbar: this.options.sidebar
}, function () { d.resolve.apply(this, arguments); }); }, callback);
} }
return d.promise();
}, },
/** /**
* re-renders the content of the list view * re-renders the content of the list view