projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
525d605
)
[FIX] static datasets: don't set the index to 0 if there are no ids at all, the form...
author
Xavier Morel
<xmo@openerp.com>
Thu, 15 Dec 2011 15:41:00 +0000
(16:41 +0100)
committer
Xavier Morel
<xmo@openerp.com>
Thu, 15 Dec 2011 15:41:00 +0000
(16:41 +0100)
lp bug: https://launchpad.net/bugs/899043 fixed
bzr revid: xmo@openerp.com-
20111215154100
-aspzga71cng767u8
addons/web/static/src/js/data.js
patch
|
blob
|
history
diff --git
a/addons/web/static/src/js/data.js
b/addons/web/static/src/js/data.js
index
aec701e
..
46393aa
100644
(file)
--- 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) {