diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-06-07 17:23:26 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-06-07 17:23:26 +0200 |
| commit | 1ea609ba651c070d1d90c3321a210a2346de17ea (patch) | |
| tree | 049b556a3a016a6d3c9cc7229845b78a013d3c91 /addons/web/static/src/js/data.js | |
| parent | aa423f4cb11b6fc50355a54b51c3a281c7b5b373 (diff) | |
[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
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 2 |
1 files changed, 1 insertions, 1 deletions
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); }, /** |
