From 22d5b6af7ea6c11283f4ec874a53b81b608d3476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 2 Feb 2026 21:57:32 +0100 Subject: [PATCH] [IMP] remove redundant SQL query and grep for missing addons The SQL query already filters on module_origin.state = 'installed', so the second query to get installed addons and the grep intersection were completely redundant. Before: 2 SQL queries + grep + 3 temp files After: 1 SQL query + variable This simplifies the code and reduces database round-trips. --- prepare_db.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/prepare_db.sh b/prepare_db.sh index c2a2873..e0be9f7 100755 --- a/prepare_db.sh +++ b/prepare_db.sh @@ -42,7 +42,7 @@ echo "Base neutralized..." ## List add-ons not in final version ## ####################################### -SQL_404_ADDONS_LIST=$(cat < "${TMPDIR}/404_addons" - -INSTALLED_ADDONS="SELECT name FROM ir_module_module WHERE state='installed';" -query_postgres_container "$INSTALLED_ADDONS" "$DB_NAME" > "${TMPDIR}/installed_addons" - -grep -Fx -f "${TMPDIR}/404_addons" "${TMPDIR}/installed_addons" > "${TMPDIR}/final_404_addons" || true +echo "Retrieve missing addons..." +missing_addons=$(query_postgres_container "$SQL_MISSING_ADDONS" "$DB_NAME") echo " ==== ADD-ONS CHECK ==== Installed add-ons not available in final Odoo version: " -cat "${TMPDIR}/final_404_addons" +echo "$missing_addons" echo "