From 67606c7571ae522d1bf480b84f9ee6d4d8f6339c Mon Sep 17 00:00:00 2001 From: "Hubert Van de Walle (huvw)" Date: Fri, 28 Apr 2023 12:00:02 +0000 Subject: [PATCH] [FIX] web: disable limit for grouped kanban views Steps to reproduce ================== - Go to a kanban view with lots of records, for example products - Remove any filter and group by name There is only 80 groups, and there is no way to get the next ones Cause of the issue ================== The `web_read_group` uses a limit, by default of 80 Solution ======== For kanban grouped views, we don't want to set a limit on the groups opw-3283004 closes odoo/odoo#120758 X-original-commit: bf772181933ce5334da35c8368455963b2478399 Signed-off-by: Aaron Bohy (aab) Signed-off-by: Hubert Van De Walle --- .../static/src/views/kanban/kanban_model.js | 1 + .../static/tests/views/kanban_view_tests.js | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/addons/web/static/src/views/kanban/kanban_model.js b/addons/web/static/src/views/kanban/kanban_model.js index 19ab65f2041..8ea5227b482 100644 --- a/addons/web/static/src/views/kanban/kanban_model.js +++ b/addons/web/static/src/views/kanban/kanban_model.js @@ -275,6 +275,7 @@ export class KanbanDynamicGroupList extends DynamicGroupList { this.previousParams = state.previousParams || "[]"; this.groupBy = this.groupBy.slice(0, 1); + this.limit = null; this.model.bus.addEventListener("group-updated", async ({ detail }) => { if (this.groups.some((g) => g.id === detail.group.id)) { diff --git a/addons/web/static/tests/views/kanban_view_tests.js b/addons/web/static/tests/views/kanban_view_tests.js index 899332fbf5a..a4101dac94c 100644 --- a/addons/web/static/tests/views/kanban_view_tests.js +++ b/addons/web/static/tests/views/kanban_view_tests.js @@ -45,6 +45,7 @@ import { ViewButton } from "@web/views/view_button/view_button"; import { Component, onWillRender, xml } from "@odoo/owl"; import { SampleServer } from "@web/views/sample_server"; +import { KanbanDynamicGroupList } from "@web/views/kanban/kanban_model"; const serviceRegistry = registry.category("services"); const viewWidgetRegistry = registry.category("view_widgets"); @@ -1119,6 +1120,27 @@ QUnit.module("Views", (hooks) => { assert.containsNone(target, ".o_pager"); }); + QUnit.test("there should be no limit on the number of fetched groups", async (assert) => { + patchWithCleanup(KanbanDynamicGroupList, { DEFAULT_LIMIT: 1 }); + + await makeView({ + type: "kanban", + resModel: "partner", + serverData, + arch: ` + + + +
+
+
+
`, + groupBy: ["product_id"], + }); + + assert.containsN(target, ".o_kanban_group", 2, "there should be 2 groups"); + }); + QUnit.test("pager, ungrouped, with default limit", async (assert) => { assert.expect(3);