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
This commit is contained in:
Janik von Rotz committed 2026-10-13 17:11:45 +02:00
1 parent 6547ed9e6f
commit f712afe2fa
2 files changed
+7 -4

No files matched your search

+4 -1
View File
@@ -1,5 +1,8 @@
{
"interfaceFontFamily": "Ubuntu Mono",
"textFontFamily": "Ubuntu Mono",
"monospaceFontFamily": "Ubuntu Mono"
"monospaceFontFamily": "Ubuntu Mono",
"enabledCssSnippets": [
"snippet"
]
}
+3 -3
View File
@@ -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.'