[FIX] web: kanban dropdown without toggler
In a kanban arch, have a dropdown that don't have a toggler, just an explicit menu. Before this commit, there was a crash. After this commit, the kanban and the dropdown are correctly rendered. closes odoo/odoo#104019 X-original-commit: 01418c474cb02455660156cf47822588f0554376 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
@@ -88,7 +88,7 @@ export class KanbanCompiler extends ViewCompiler {
|
||||
return this.renderDropdown(part);
|
||||
}
|
||||
dropdown.parts.push(part);
|
||||
if (part !== "menu") {
|
||||
if (part !== "menu" || dropdown.parts.includes("dropdown")) {
|
||||
dropdown.shouldInsert = !dropdown.inserted;
|
||||
dropdown.inserted = true;
|
||||
}
|
||||
|
||||
@@ -380,6 +380,34 @@ QUnit.module("Views", (hooks) => {
|
||||
assert.strictEqual(target.querySelector("span.o_text_block").textContent, "yop");
|
||||
});
|
||||
|
||||
QUnit.test("dropdown without toggler are correctly rendered", async (assert) => {
|
||||
serverData.models.partner.records = [serverData.models.partner.records[0]];
|
||||
await makeView({
|
||||
type: "kanban",
|
||||
resModel: "partner",
|
||||
serverData,
|
||||
arch: `
|
||||
<kanban class="o_kanban_test">
|
||||
<templates><t t-name="kanban-box">
|
||||
<div>
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-menu">
|
||||
<a class="someItem" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t></templates>
|
||||
</kanban>`,
|
||||
});
|
||||
|
||||
assert.containsOnce(target, ".o-dropdown.dropdown.o_dropdown_kanban");
|
||||
await click(target, ".o_kanban_record .o-dropdown button.dropdown-toggle");
|
||||
assert.containsOnce(
|
||||
target,
|
||||
".o_kanban_record .o-dropdown .o-dropdown--menu > div > a.someItem"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("basic grouped rendering", async (assert) => {
|
||||
assert.expect(13);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user