From f712afe2fa0faa86c9eeb9562c6c4b7c0fc0017c Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Tue, 13 Oct 2026 17:11:45 +0200 Subject: [PATCH] fix: correct Odoo init script demo flag logic to enable demo data - Fix variable naming in `roles/odoo/files/docker-odoo-init` from `without_demo` to `with_demo` to accurately reflect the intended behavior - Update the `-w` flag handling to set `with_demo` to `--with-demo` instead of clearing the `without_demo` variable - Ensure the Odoo initialization command correctly passes the demo flag when the `-w` option is provided - Add `snippet` to `enabledCssSnippets` in `.obsidian/appearance.json` to activate the custom CSS snippet --- .obsidian/appearance.json | 5 ++++- roles/odoo/files/docker-odoo-init | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json index 45991554..59ebc98e 100644 --- a/.obsidian/appearance.json +++ b/.obsidian/appearance.json @@ -1,5 +1,8 @@ { "interfaceFontFamily": "Ubuntu Mono", "textFontFamily": "Ubuntu Mono", - "monospaceFontFamily": "Ubuntu Mono" + "monospaceFontFamily": "Ubuntu Mono", + "enabledCssSnippets": [ + "snippet" + ] } \ No newline at end of file diff --git a/roles/odoo/files/docker-odoo-init b/roles/odoo/files/docker-odoo-init index 8760ec54..4f8434a6 100755 --- a/roles/odoo/files/docker-odoo-init +++ b/roles/odoo/files/docker-odoo-init @@ -27,7 +27,7 @@ if [[ "$1" == 'help' ]]; then exit fi -without_demo='--without-demo=all' +with_demo='--without-demo=all' container=odoo odoo_language=en_US @@ -37,7 +37,7 @@ while getopts ':c: :d: :i: :l: :w :V' opt; do d) database="$OPTARG";; i) modules="$OPTARG";; l) odoo_language="$OPTARG";; - w) without_demo='';; + w) with_demo='--with-demo';; V) echo "$script version $version" exit 0 ;; @@ -57,7 +57,7 @@ echo "Initializing modules $modules with langague $odoo_language on database $da docker exec $container_id /bin/bash -c " unset ODOO_ADDONS_PATH unset ADDONS_PATH -odoo -i $modules -d $database --db_host=\$PGHOST --db_user=\$PGUSER --db_password=\$PGPASSWORD $without_demo --load-language $odoo_language --stop-after-init --no-http +odoo -i $modules -d $database --db_host=\$PGHOST --db_user=\$PGUSER --db_password=\$PGPASSWORD $with_demo --load-language $odoo_language --stop-after-init --no-http " echo 'Modules initialized. Please restart the Odoo container/process.'