[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) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
This commit is contained in:
Hubert Van de Walle (huvw)
2023-05-09 06:07:25 +02:00
parent 25f7da6c0b
commit 67606c7571
2 changed files with 23 additions and 0 deletions
@@ -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)) {
@@ -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: `
<kanban>
<templates>
<t t-name="kanban-box">
<div><field name="foo"/></div>
</t>
</templates>
</kanban>`,
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);