From 03cdc9c41751dd484a59ccba6b7124cd26f13509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 9 Nov 2022 15:59:55 +0000 Subject: [PATCH] [IMP] web: prevent duplicate entries in QUnit dropdown search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is really annoying to have thousands of duplicate entries in that dropdown menu. This commit hacks the problem away, but modifying QUnit in place. Some day, we should modernize our testing infrastructure, but this will do the trick in the mean time. closes odoo/odoo#105483 Signed-off-by: Georis François (fge) --- addons/web/static/lib/qunit/qunit-2.9.1.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/web/static/lib/qunit/qunit-2.9.1.js b/addons/web/static/lib/qunit/qunit-2.9.1.js index a78a25ecbbc..fc886ffaa37 100644 --- a/addons/web/static/lib/qunit/qunit-2.9.1.js +++ b/addons/web/static/lib/qunit/qunit-2.9.1.js @@ -4903,9 +4903,11 @@ var i, checked, html = ""; - + const names = new Set(); for (i = 0; i < config.modules.length; i++) { - if (config.modules[i].name !== "") { + const name = config.modules[i].name; + if (name !== "" && !names.has(name)) { + names.add(name); checked = config.moduleId.indexOf(config.modules[i].moduleId) > -1; html += "
  • "; }