From 643f3116c9b5ba5e7f73262d8cfe6ebc797965f3 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 3 Aug 2011 13:31:37 +0200 Subject: [PATCH] [FIX] resequencing of rows during drag & drop I don't even understand how it worked before as the terminal condition would really just blow up. Also, redisplay resequenced rows bzr revid: xmo@openerp.com-20110803113137-46ddhdail0d4m3ie --- addons/base/static/src/js/list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index d64d83329c0..4a8cbf11249 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -1156,12 +1156,14 @@ openerp.base.ListView.Groups = openerp.base.Class.extend( /** @lends openerp.bas // if drag to 1st row (to = 0), start sequencing from 0 // (exclusive lower bound) seq = to ? list.rows[to - 1].data.sequence.value : 0; - while (++seq, data = list.rows[index++].data) { + while (++seq, list.rows[index]) { + data = list.rows[index].data; data.sequence.value = seq; // write are independent from one another, so we can just // launch them all at the same time and we don't really // give a fig about when they're done dataset.write(data.id.value, {sequence: seq}); + list.reload_record(index++); } } });