[FIX] correctly set dataset index when selecting a record in list view, so switching to page/form switches to the first selected record, not the first record of the page
lp bug: https://launchpad.net/bugs/939314 fixed bzr revid: xmo@openerp.com-20120223145157-rkkwg6pwcr6hh7st
This commit is contained in:
parent
819334f0aa
commit
a55e7148e3
|
@ -540,19 +540,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
||||||
* @param {Array} records selected record values
|
* @param {Array} records selected record values
|
||||||
*/
|
*/
|
||||||
do_select: function (ids, records) {
|
do_select: function (ids, records) {
|
||||||
this.$element.find('.oe-list-delete')
|
this.$element.find('.oe-list-delete').attr('disabled', !ids.length);
|
||||||
.attr('disabled', !ids.length);
|
if (!ids.length) {
|
||||||
if (this.sidebar) {
|
this.dataset.index = 0;
|
||||||
if (ids.length) {
|
if (this.sidebar) { this.sidebar.do_fold(); }
|
||||||
this.sidebar.do_unfold();
|
|
||||||
} else {
|
|
||||||
this.sidebar.do_fold();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!records.length) {
|
|
||||||
this.compute_aggregates();
|
this.compute_aggregates();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.dataset.index = _(this.dataset.ids).indexOf(ids[0]);
|
||||||
|
if (this.sidebar) { this.sidebar.do_unfold(); }
|
||||||
|
|
||||||
this.compute_aggregates(_(records).map(function (record) {
|
this.compute_aggregates(_(records).map(function (record) {
|
||||||
return {count: 1, values: record};
|
return {count: 1, values: record};
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue