lp bug: https://launchpad.net/bugs/900225 fixed
bzr revid: xmo@openerp.com-
20111219125039-049o944efkkl2sk9
},
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;
this._super.apply(this, arguments);
this.registry = openerp.web.page.readonly;
},
+ reload: function () {
+ if (this.dataset.index == null) {
+ this.do_prev_view();
+ return $.Deferred().reject().promise();
+ }
+ return this._super();
+ },
on_loaded: function(data) {
this._super(data);
this.$form_header.find('button.oe_form_button_edit').click(this.on_button_edit);