From 0cecc93aa42cfafdcaddec5b46fbdae54fe31acb Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 4 Jun 2021 15:32:09 +0200 Subject: [PATCH] [FIX] web: legacy dialog: select only one o_dialog_container to append in Before this commit, when a test had multiple o_dialog_container elements (the one where we put the actual modal), a legacy dialog was appended multiple times in the DOM messing around with the test After this commit, we force dialogs to append once by selecting the first container it finds --- addons/web/static/src/legacy/js/core/dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/legacy/js/core/dialog.js b/addons/web/static/src/legacy/js/core/dialog.js index 1b1092dc1da..7cef878b1bc 100644 --- a/addons/web/static/src/legacy/js/core/dialog.js +++ b/addons/web/static/src/legacy/js/core/dialog.js @@ -83,7 +83,7 @@ var Dialog = Widget.extend({ $content: false, buttons: [{text: _t("Ok"), close: true}], technical: true, - $parentNode: false || $(".o_dialog_container"), + $parentNode: false || $(document.body.querySelector(".o_dialog_container")), backdrop: 'static', renderHeader: true, renderFooter: true,