diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-07-26 14:37:05 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-07-26 14:37:05 +0200 |
| commit | abde98eb16f9f3a6a7750eb91f9337a091f9828a (patch) | |
| tree | cc9d561b6068d4d9e06fb0972aa5712e1ba53c8e /addons/web/static/src/js/data_export.js | |
| parent | 65c7a6fedbf3e740708f31912726fdd3a26e9473 (diff) | |
| parent | 7aec524456080618a4b0ad4b72af4bafca1b889d (diff) | |
[MERGE] active_domain management for mass actions
[IMP] list_view: uncheck header hook when unchecking one of the row displayed in the list view. This is done through the propagation of a deselected flag through the 'selected' event.
[IMP] list_view: added get_active_domain method that returns the evaluated current domain (from the search view), if the header hook is checked
[IMP] sidebar (More menu): add in the action context the active_domain if the list header hook is checked
[IMP] export: now works on the active_domain if the list header hook is checked; otherwise use selected_ids. The search using the active_domain is done in the python code, not JS-side.
bzr revid: tde@openerp.com-20130726123705-vdtzxmmk5tszrwqf
Diffstat (limited to 'addons/web/static/src/js/data_export.js')
| -rw-r--r-- | addons/web/static/src/js/data_export.js | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index 0540a0acbe8..8de6cc506b9 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -378,21 +378,28 @@ instance.web.DataExport = instance.web.Dialog.extend({ exported_fields.unshift({name: 'id', label: 'External ID'}); var export_format = this.$el.find("#export_format").val(); - var ids_to_export = this.$('#export_selection_only').prop('checked') - ? this.getParent().get_selected_ids() - : this.dataset.ids; - instance.web.blockUI(); - this.session.get_file({ - url: '/web/export/' + export_format, - data: {data: JSON.stringify({ - model: this.dataset.model, - fields: exported_fields, - ids: ids_to_export, - domain: this.dataset.domain, - import_compat: !!this.$el.find("#import_compat").val(), - })}, - complete: instance.web.unblockUI, + this.getParent().get_active_domain().then(function (domain) { + if (domain === undefined) { + var ids_to_export = self.getParent().get_selected_ids(); + var domain = self.dataset.domain; + } + else { + var ids_to_export = false; + var domain = domain; + } + instance.web.blockUI(); + self.session.get_file({ + url: '/web/export/' + export_format, + data: {data: JSON.stringify({ + model: self.dataset.model, + fields: exported_fields, + ids: ids_to_export, + domain: domain, + import_compat: !!self.$el.find("#import_compat").val(), + })}, + complete: instance.web.unblockUI, + }); }); }, close: function() { |
