diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 5296c6db7d5..57ef031a146 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3652,6 +3652,10 @@ var BasicModel = AbstractModel.extend({ // Also keep data if we only reload groups' own data delete updatedProps.data; } + // set the limit such that all previously loaded records + // (e.g. if we are coming back to the kanban view from a + // form view) are reloaded + oldGroup.limit = oldGroup.limit + oldGroup.loadMoreOffset; _.extend(oldGroup, updatedProps); newGroup = oldGroup; } else if (!newGroup.openGroupByDefault) { diff --git a/addons/web/static/tests/views/kanban_tests.js b/addons/web/static/tests/views/kanban_tests.js index 97978da9be0..f003bba199c 100644 --- a/addons/web/static/tests/views/kanban_tests.js +++ b/addons/web/static/tests/views/kanban_tests.js @@ -1962,10 +1962,9 @@ QUnit.module('Views', { "the records should be correctly fetched"); // reload - envIDs = [1, 2, 4]; // first group is limited again to 2 records kanban.reload(); - assert.strictEqual(kanban.$('.o_kanban_group:eq(1) .o_kanban_record').length, 2, - "there should be 2 records in the column after reload"); + assert.strictEqual(kanban.$('.o_kanban_group:eq(1) .o_kanban_record').length, 3, + "there should still be 3 records in the column after reload"); kanban.destroy(); });