[IMP] add function to execute python scripts in Odoo shell

This commit is contained in:
Stéphan Sainléger
2026-01-13 12:37:38 +01:00
parent f18d50cb94
commit 469fb42e48

View File

@@ -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 #
##############################################