[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
This commit is contained in:
Xavier Morel
2011-08-03 13:31:37 +02:00
parent 0e597e8ef3
commit 643f3116c9
+3 -1
View File
@@ -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++);
}
}
});