~openerp-dev/openerp-web/7.0-bug-1179505-bth

« back to all changes in this revision

Viewing changes to addons/web_kanban/static/src/js/kanban.js

  • Committer: niv-openerp
  • Date: 2013-04-30 09:48:43 UTC
  • Revision ID: nicolas.vanhoren@openerp.com-20130430094843-9m1629m517vjtm1o
[FIX] optimization necessary in some cases when kanban views can take more that 10 seconds to load

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
            var remaining = groups.length - 1,
260
260
                groups_array = [];
261
261
            return $.when.apply(null, _.map(groups, function (group, index) {
 
262
                var def = $.when([]);
262
263
                var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
263
264
                    new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain());
264
 
                return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit })
265
 
                    .then(function(records) {
 
265
                if (group.attributes.length >= 1) {
 
266
                    def = dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit });
 
267
                }
 
268
                return def.then(function(records) {
266
269
                        self.dataset.ids.push.apply(self.dataset.ids, dataset.ids);
267
270
                        groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset);
268
271
                        if (!remaining--) {