[FIX] DataSet#size() problem + FormView#on_button_delete() shall pop breadcrumb on empty dataset
bzr revid: fme@openerp.com-20130404101459-m9q90e32qwf068lw
This commit is contained in:
parent
47be40b075
commit
8a20760fc8
|
@ -716,7 +716,7 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({
|
|||
});
|
||||
},
|
||||
size: function () {
|
||||
if (this._length !== undefined) {
|
||||
if (this._length != null) {
|
||||
return this._length;
|
||||
}
|
||||
return this._super();
|
||||
|
|
|
@ -765,7 +765,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
this.has_been_loaded.done(function() {
|
||||
if (self.datarecord.id && confirm(_t("Do you really want to delete this record?"))) {
|
||||
self.dataset.unlink([self.datarecord.id]).done(function() {
|
||||
self.execute_pager_action('next');
|
||||
if (self.dataset.size()) {
|
||||
self.execute_pager_action('next');
|
||||
} else {
|
||||
self.do_action('history_back');
|
||||
}
|
||||
def.resolve();
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue