diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-12-15 19:43:05 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-12-15 19:43:05 +0100 |
| commit | 2fd2f299b40a03044e5700509f18ae2ac2c0afce (patch) | |
| tree | 67d8b4faa981df4b308bcf6261095c0f898fc77a /addons/web/static/src/js/data.js | |
| parent | 4206e4d2627be8ca252fdfce2f90654ff9db0055 (diff) | |
| parent | 72e820765fccc9227c8b684e3d42f6344756cffc (diff) | |
[MERGE] trunk
bzr revid: al@openerp.com-20111215184305-3yxw54l91psrz5d6
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index aec701e6e67..46393aaf205 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -510,9 +510,10 @@ openerp.web.DataSetStatic = openerp.web.DataSet.extend({ }, set_ids: function (ids) { this.ids = ids; - if (this.index !== null) { - this.index = this.index <= this.ids.length - 1 ? - this.index : (this.ids.length > 0 ? this.length - 1 : 0); + if (ids.length === 0) { + this.index = null; + } else if (this.index >= ids.length - 1) { + this.index = ids.length - 1; } }, unlink: function(ids) { |
