[FIX] web: kanban: disallow to quick create if cannot create
Before this commit, a grouped kanban view with create="0" on the root node would still allow to quick create record in columns (i.e. the "+" icon would still be displayed). However, clicking on it would most likely raise an AccessError as the user isn't allowed to create records. This commit restores the pre 16.0 behavior, which is to disallow quick creation if the user can't create. Task 3559638 closes odoo/odoo#141631 X-original-commit: 775475aaed6ea88f54a6530b81f35f3114431716 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
@@ -34,14 +34,13 @@ export class KanbanArchParser {
|
||||
const countLimit = xmlDoc.getAttribute("count_limit");
|
||||
const recordsDraggable = archParseBoolean(xmlDoc.getAttribute("records_draggable"), true);
|
||||
const groupsDraggable = archParseBoolean(xmlDoc.getAttribute("groups_draggable"), true);
|
||||
const activeActions = {
|
||||
...getActiveActions(xmlDoc),
|
||||
archiveGroup: archParseBoolean(xmlDoc.getAttribute("archivable"), true),
|
||||
createGroup: archParseBoolean(xmlDoc.getAttribute("group_create"), true),
|
||||
deleteGroup: archParseBoolean(xmlDoc.getAttribute("group_delete"), true),
|
||||
editGroup: archParseBoolean(xmlDoc.getAttribute("group_edit"), true),
|
||||
quickCreate: archParseBoolean(xmlDoc.getAttribute("quick_create"), true),
|
||||
};
|
||||
const activeActions = getActiveActions(xmlDoc);
|
||||
activeActions.archiveGroup = archParseBoolean(xmlDoc.getAttribute("archivable"), true);
|
||||
activeActions.createGroup = archParseBoolean(xmlDoc.getAttribute("group_create"), true);
|
||||
activeActions.deleteGroup = archParseBoolean(xmlDoc.getAttribute("group_delete"), true);
|
||||
activeActions.editGroup = archParseBoolean(xmlDoc.getAttribute("group_edit"), true);
|
||||
activeActions.quickCreate =
|
||||
activeActions.create && archParseBoolean(xmlDoc.getAttribute("quick_create"), true);
|
||||
const onCreate = xmlDoc.getAttribute("on_create");
|
||||
const quickCreateView = xmlDoc.getAttribute("quick_create_view");
|
||||
const tooltipInfo = {};
|
||||
|
||||
@@ -5621,6 +5621,8 @@ QUnit.module("Views", (hooks) => {
|
||||
});
|
||||
|
||||
assert.containsNone(target, ".o-kanban-button-new");
|
||||
assert.containsN(target, ".o_kanban_group", 2);
|
||||
assert.containsNone(target, ".o_kanban_quick_add");
|
||||
});
|
||||
|
||||
QUnit.test("clicking on a link triggers correct event", async (assert) => {
|
||||
|
||||
Reference in New Issue
Block a user