diff options
| author | ima-openerp <ima@tinyerp.com> | 2013-10-21 18:12:22 +0530 |
|---|---|---|
| committer | ima-openerp <ima@tinyerp.com> | 2013-10-21 18:12:22 +0530 |
| commit | 7678ea996fbf0fcd146bd7ffbf75ab450db7dd4e (patch) | |
| tree | a854e1029302edfe582f594bc2f684aaeec9e45d /addons/web/static/src/js/view_list.js | |
| parent | 8acd61c43e7d47f3c83d19aa3c3f1d4fd4547c10 (diff) | |
| parent | ebeeae0ed4c57e36db143c11de11174ca1330892 (diff) | |
[MERGE]with trunk.
bzr revid: ima@tinyerp.com-20131021124222-7j3xc1ahtek5gyuw
Diffstat (limited to 'addons/web/static/src/js/view_list.js')
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index f9ec22bf712..ba7c58b3820 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -508,10 +508,15 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi var reloaded = $.Deferred(); this.$el.find('.oe_list_content').append( this.groups.render(function () { - if ((self.dataset.index === null || self.dataset.index === undefined) && self.records.length || - self.dataset.index >= self.records.length) { + // Keep '=='. This is not a mistake, this is a wanted behaviour to match null & undefined + if (self.dataset.index == null) { + if (self.records.length) { self.dataset.index = 0; + } + } else if (self.dataset.index >= self.records.length) { + self.dataset.index = 0; } + self.compute_aggregates(); reloaded.resolve(); })); @@ -802,9 +807,11 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi }, /** * Calculate the active domain of the list view. This should be done only - * if the header checkbox has been checked. + * if the header checkbox has been checked. This is done by evaluating the + * search results, and then adding the dataset domain (i.e. action domain). */ get_active_domain: function () { + var self = this; if (this.$('.oe_list_record_selector').prop('checked')) { var search_view = this.getParent().searchview; var search_data = search_view.build_search_data(); @@ -813,7 +820,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi contexts: search_data.contexts, group_by_seq: search_data.groupbys || [] }).then(function (results) { - return results.domain; + var domain = self.dataset.domain.concat(results.domain || []); + return domain }); } else { |
