From 80d85edb1a4b13e584864677814ddba6f9d5cef7 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Tue, 30 Aug 2022 13:51:14 +0000 Subject: [PATCH] [FIX] web: kanban quick create with legacy many2one Have a quick create view in kanban that has a legacy many2one field (not yet converted to the WOWL framework for some reason). Click on that many2one to see the dropdown of propositions. Click on one proposition. Before this commit, the quick create got closed, because we clicked somewhere outside of it (the legacy dropdown). This is a known, quite common issue in some other part of the codebase (see d3662d370c97ccc31a11a3378f93e0be0a79b66a). After this commit, the quick create works as expected. closes odoo/odoo#99241 Signed-off-by: Aaron Bohy (aab) --- .../static/src/views/kanban/kanban_record_quick_create.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/views/kanban/kanban_record_quick_create.js b/addons/web/static/src/views/kanban/kanban_record_quick_create.js index bc5e52b3a5e..5e3cf661b41 100644 --- a/addons/web/static/src/views/kanban/kanban_record_quick_create.js +++ b/addons/web/static/src/views/kanban/kanban_record_quick_create.js @@ -34,8 +34,12 @@ export class KanbanRecordQuickCreate extends Component { return; } const target = this.mousedownTarget || ev.target; - const gotClickedOutside = !this.rootRef.el.contains(target); - if (gotClickedOutside) { + // accounts for clicking on legacy daterangepicker and legacy autocomplete + const gotClickedInside = + target.closest(".daterangepicker") || + target.closest(".ui-autocomplete") || + this.rootRef.el.contains(target); + if (!gotClickedInside) { let force = false; for (const selector of ACTION_SELECTORS) { const closestEl = target.closest(selector);