[IMP] option to only export selected records
lp bug: https://launchpad.net/bugs/900385 fixed bzr revid: xmo@openerp.com-20130530094525-1ub1yhdqsag6xxzq
This commit is contained in:
parent
c063ef4109
commit
03b80e154e
|
@ -376,16 +376,20 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
||||||
alert(_t("Please select fields to export..."));
|
alert(_t("Please select fields to export..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
exported_fields.unshift({name: 'id', label: 'External ID'});
|
exported_fields.unshift({name: 'id', label: 'External ID'});
|
||||||
|
|
||||||
var export_format = this.$el.find("#export_format").val();
|
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();
|
instance.web.blockUI();
|
||||||
this.session.get_file({
|
this.session.get_file({
|
||||||
url: '/web/export/' + export_format,
|
url: '/web/export/' + export_format,
|
||||||
data: {data: JSON.stringify({
|
data: {data: JSON.stringify({
|
||||||
model: this.dataset.model,
|
model: this.dataset.model,
|
||||||
fields: exported_fields,
|
fields: exported_fields,
|
||||||
ids: this.dataset.ids,
|
ids: ids_to_export,
|
||||||
domain: this.dataset.domain,
|
domain: this.dataset.domain,
|
||||||
import_compat: Boolean(
|
import_compat: Boolean(
|
||||||
this.$el.find("#import_compat").val())
|
this.$el.find("#import_compat").val())
|
||||||
|
|
|
@ -1699,6 +1699,9 @@
|
||||||
|
|
||||||
<label for="export_format">Export Formats</label>
|
<label for="export_format">Export Formats</label>
|
||||||
<select id="export_format" name="export_format"></select>
|
<select id="export_format" name="export_format"></select>
|
||||||
|
|
||||||
|
<label for="export_selection_only">Only export selection:</label>
|
||||||
|
<input type="checkbox" id="export_selection_only"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue