[IMP] web: prevent duplicate entries in QUnit dropdown search

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) <fge@odoo.com>
This commit is contained in:
Géry Debongnie
2022-11-10 12:22:05 +01:00
parent e1e9b19af3
commit 03cdc9c417
+4 -2
View File
@@ -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 += "<li><label class='clickable" + (checked ? " checked" : "") + "'><input type='checkbox' " + "value='" + config.modules[i].moduleId + "'" + (checked ? " checked='checked'" : "") + " />" + escapeText(config.modules[i].name) + "</label></li>";
}