[IMP] web: order fields in export wizard

(Closes #1645)
This commit is contained in:
rba-odoo
2014-08-12 10:57:53 +02:00
committed by Richard Mathot
parent b3494fc042
commit 1d2fa422df
2 changed files with 18 additions and 0 deletions
+16
View File
@@ -27,6 +27,8 @@ instance.web.DataExport = instance.web.Dialog.extend({
this.$('#fields_list').empty();
},
'click #export_new_list': 'on_show_save_list',
'click #move_up':'on_click_move_up',
'click #move_down':'on_click_move_down',
},
init: function(parent, dataset) {
var self = this;
@@ -79,6 +81,20 @@ instance.web.DataExport = instance.web.Dialog.extend({
this.rpc('/web/export/formats', {}).done(this.do_setup_export_formats),
this.show_exports_list());
},
on_click_move_up: function () {
var prev_row = this.$el.find('#fields_list option:selected').first().prev();
if(prev_row.length){
var selected_rows = self.$('#fields_list option:selected').detach();
prev_row.before(selected_rows);
}
},
on_click_move_down: function () {
var next_row = this.$el.find('#fields_list option:selected').last().next();
if(next_row.length){
var selected_rows = self.$('#fields_list option:selected').detach();
next_row.after(selected_rows);
}
},
do_setup_export_formats: function (formats) {
var $fmts = this.$el.find('#export_format');
_(formats).each(function (format) {
+2
View File
@@ -1768,6 +1768,8 @@
<button class="oe_button" id="add_field">Add</button>
<button class="oe_button" id="remove_field">Remove</button>
<button class="oe_button" id="remove_all_field">Remove All</button>
<button class="oe_button" id="move_up">Move Up</button>
<button class="oe_button" id="move_down">Move Down</button>
</td>
<td class="oe_export_fields_selector_right">
<select name="fields_list" id="fields_list"