From 0fbdaab88fb976ec4c54b613297d0a5710b29137 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 6 Dec 2011 09:27:13 +0100 Subject: [PATCH] [FIX] defer actually writing the resequencing of a list view to the backing dataset ~/projects/tiny/web/current There seems to be an issue with synchronous o2m writes doing weird things (records disappear after being drag & dropped) lp bug: https://launchpad.net/bugs/900207 fixed bzr revid: xmo@openerp.com-20111206082713-efq1w88sv0htl39c --- addons/web/static/src/js/view_list.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index a9b4f1014b1..73cf453d4ca 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1296,7 +1296,14 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L // 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(record.get('id'), {sequence: seq}); + // FIXME: breaks on o2ms (e.g. Accounting > Financial + // Accounting > Taxes > Taxes, child tax accounts) + // when synchronous (without setTimeout) + (function (dataset, id, seq) { + setTimeout(function () { + dataset.write(id, {sequence: seq}); + }, 0); + }(dataset, record.get('id'), seq)); record.set('sequence', seq); }