From 26bf35260d535f21f28180873f11e58cac2fe5da Mon Sep 17 00:00:00 2001 From: Julien Legros Date: Fri, 19 Dec 2014 15:08:25 +0100 Subject: [PATCH] [FIX] web: reordering in editable list views Broaden the set of conditions where reordering is allowed. Lists can be reordered when they are sorted by sequence (or sequence ASC) opw-619465 --- addons/web/static/src/js/view_list.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 3779e5cd219..1e541e3fc6c 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1539,9 +1539,11 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we }); }, setup_resequence_rows: function (list, dataset) { - // drag and drop enabled if list is not sorted and there is a - // visible column with @widget=handle or "sequence" column in the view. - if ((dataset.sort && dataset.sort()) + // drag and drop enabled if list is not sorted (unless it is sorted by + // sequence (ASC)), and there is a visible column with @widget=handle + // or "sequence" column in the view. + if ((dataset.sort && dataset.sort() && dataset.sort() !== 'sequence' + && dataset.sort() !== 'sequence ASC') || !_(this.columns).any(function (column) { return column.widget === 'handle' || column.name === 'sequence'; })) {