From 469fb42e48f7c5d56582c83003bdde04a6534cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Tue, 13 Jan 2026 12:37:38 +0100 Subject: [PATCH] [IMP] add function to execute python scripts in Odoo shell --- upgrade.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/upgrade.sh b/upgrade.sh index f4d0895..cedfd04 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -78,6 +78,15 @@ copy_filestore(){ } export -f copy_filestore +# Function to launch python scripts in Odoo Shell +exec_python_script_in_odoo_shell(){ + local SERVICE_NAME="$1" + local DB_NAME="$2" + local PYTHON_SCRIPT="$3" + compose --debug run "$SERVICE_NAME" shell -d "$DB_NAME" --no-http --stop-after-init < "$PYTHON_SCRIPT" +} +export -f exec_python_script_in_odoo_shell + ############################################## # CHECKS ALL NEEDED COMPONENTS ARE AVAILABLE # ##############################################