From 7c1cf4f68356e534be3a2e035b428b0c8b33add5 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Tue, 25 Oct 2022 14:50:50 +0000 Subject: [PATCH] [FIX] web: kanbanRenderer can choose if it supports Sortable Before this commit, there was no way to set a finer condition upon which the KanbanRenderer enables its sortable feature, that is, the drag and drop of kanban cards. After this commit, a getter is used instead of the hardcoded condition which checked whether the the screen was small in the env. It makes the KanbanRenderer more extendable. closes odoo/odoo#105026 X-original-commit: 731371320a441cc10b97b7f45b511298c45ae10a Related: odoo/enterprise#33640 Signed-off-by: Aaron Bohy (aab) Signed-off-by: Lucas Perais (lpe) --- addons/web/static/src/views/kanban/kanban_renderer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/views/kanban/kanban_renderer.js b/addons/web/static/src/views/kanban/kanban_renderer.js index 7dad029fe85..726af40193c 100644 --- a/addons/web/static/src/views/kanban/kanban_renderer.js +++ b/addons/web/static/src/views/kanban/kanban_renderer.js @@ -41,7 +41,7 @@ export class KanbanRenderer extends Component { let dataRecordId; let dataGroupId; const rootRef = useRef("root"); - if (!this.env.isSmall) { + if (this.canUseSortable) { useSortable({ enable: () => this.canResequenceRecords, // Params @@ -151,6 +151,10 @@ export class KanbanRenderer extends Component { // Getters // ------------------------------------------------------------------------ + get canUseSortable() { + return !this.env.isSmall; + } + get canMoveRecords() { if (!this.canResequenceRecords) { return false;