summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorrba-odoo <rba@openerp.com>2014-06-26 15:38:19 +0530
committerRichard Mathot <rim@openerp.com>2014-08-12 10:57:53 +0200
commit1d2fa422df3c889542252cd7b8fb37fe158415b3 (patch)
tree870a9b73dffd7912b3610e17ddabd284ce2ce53e /addons/web/static/src
parentb3494fc042d5c86c516d6c355b99f4df3796a44c (diff)
[IMP] web: order fields in export wizard
(Closes #1645)
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/data_export.js16
-rw-r--r--addons/web/static/src/xml/base.xml2
2 files changed, 18 insertions, 0 deletions
diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js
index 2f7ff81d089..a6cb35423fb 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 2aeed9e6017..b1c6ba3c336 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -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"