[FIX] static datasets: don't set the index to 0 if there are no ids at all, the form view does not like it
lp bug: https://launchpad.net/bugs/899043 fixed bzr revid: xmo@openerp.com-20111215154100-aspzga71cng767u8
This commit is contained in:
parent
525d60523e
commit
308c975967
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue