From d8dd8fc14bda8e3888a1580b9e344754b862f558 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Thu, 9 May 2013 14:21:02 +0530 Subject: [FIX]Fixe the issue of listview record re-ordering which is not working due to revision 3898. bzr revid: msh@openerp.com-20130509085102-ln4lidp7caqw25ur --- addons/web/static/src/js/data.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js/data.js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index d60f72c6577..96521c6a885 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -610,6 +610,9 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, remove_ids: function (ids) { this.alter_ids(_(this.ids).difference(ids)); }, + add_ids: function(ids) { + this.alter_ids(_(this.ids).union(ids)); + }, /** * Resequence records. * -- cgit v1.2.3 From 1ea609ba651c070d1d90c3321a210a2346de17ea Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 7 Jun 2013 17:23:26 +0200 Subject: [FIX] bugs discovered by failing onwrite test case Following xmo@openerp.com-20130607120355-x3poxy2ar2bpqqvw: * add_ids should not add ids which are already in the dataset, this leads to duplicates which the web client does not overly like * methods which add or remove records should not manipulate dataset.ids as well as that's now automatic (on_write feature) * record add should only insert the id in the dataset on non-false ids (e.g. list edition uses "pending" record with false id during creation, then sets the id it got from create() call) bzr revid: xmo@openerp.com-20130607152326-2pja1kuwo0ropfuw --- addons/web/static/src/js/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/data.js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 5884336dcfe..679afe77bcd 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -626,7 +626,7 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, this.alter_ids(_(this.ids).difference(ids)); }, add_ids: function(ids, at) { - var args = [at, 0].concat(ids); + var args = [at, 0].concat(_.difference(ids, this.ids)); this.ids.splice.apply(this.ids, args); }, /** -- cgit v1.2.3