diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-12-19 13:50:39 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-12-19 13:50:39 +0100 |
| commit | d8df2d5e17e9788538ec891b7c39c0a5abf9e02d (patch) | |
| tree | 6332bd0d2100164a0548da758092a08892c245b4 /addons/web/static/src/js/data.js | |
| parent | eec5f1c6c4af40860b9544c516d0786cf6ad0d22 (diff) | |
[FIX] have page view force a return to the previous view if switched to with no record
lp bug: https://launchpad.net/bugs/900225 fixed
bzr revid: xmo@openerp.com-20111219125039-049o944efkkl2sk9
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 46393aaf205..f3a364e37d7 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -252,14 +252,18 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet }, previous: function () { this.index -= 1; - if (this.index < 0) { + if (!this.ids.length) { + this.index = null; + } else if (this.index < 0) { this.index = this.ids.length - 1; } return this; }, next: function () { this.index += 1; - if (this.index >= this.ids.length) { + if (!this.ids.length) { + this.index = null; + } else if (this.index >= this.ids.length) { this.index = 0; } return this; |
