[FIX] web: on switch form (from list & kanban) do not load record if empty dataset
This commit is contained in:
parent
b2f1c764cd
commit
60ab6f111e
|
@ -511,7 +511,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
self.dataset.index = 0;
|
||||
}
|
||||
} else if (self.dataset.index >= self.records.length) {
|
||||
self.dataset.index = 0;
|
||||
self.dataset.index = self.records.length ? 0 : null;
|
||||
}
|
||||
|
||||
self.compute_aggregates();
|
||||
|
|
|
@ -290,6 +290,8 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
|
||||
if (!_.isEmpty(self.dataset.ids) && (self.dataset.index === null || self.dataset.index >= self.dataset.ids.length)) {
|
||||
self.dataset.index = 0;
|
||||
} else if (_.isEmpty(self.dataset.ids)){
|
||||
self.dataset.index = null;
|
||||
}
|
||||
self.do_add_groups([kgroup]).done(function() {
|
||||
if (_.isEmpty(records)) {
|
||||
|
|
Loading…
Reference in New Issue