From: rba-odoo Date: Thu, 26 Jun 2014 10:08:19 +0000 (+0530) Subject: [IMP] web: order fields in export wizard X-Git-Tag: InsPy_master01~1^2~2 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=1d2fa422df3c889542252cd7b8fb37fe158415b3;p=odoo%2Fodoo.git [IMP] web: order fields in export wizard (Closes #1645) --- diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index 2f7ff81..a6cb354 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -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) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 2aeed9e..b1c6ba3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1768,6 +1768,8 @@ + +