zebroo-tools/zodoo(新しいタブで開きます)
主要言語: Python
Zodoo - the new zebroo version of wodoo
- star 数
- 3
- watcher 数
- 1
- fork 数
- 1
- issue 数
- 3
- 最終更新
- 2026/10/30
主要言語: Python
Zodoo - the new zebroo version of wodoo
Provides functionalities:
setup empty new odoo with one bash command odoo init --version 15.0
setup full fleged odoo server environment containing
fzf compatible creation of and AST of your project
fast restore / create snapshots of complete databases using btrfs, which helps testing things on customer databases
User-facing documentation lives in docs/ and is published
at https://docusaurus.zebroo.de/docs/zodoo. Everything in that folder is
published, so it should read as documentation — keep contributor and
build instructions here instead.
When editing it:
docs/img/, referenced relatively:
.010-, 020-, 030-), never sidebar_position frontmatter, and
never both. To insert a page between two others, pick a number between them:
025-new-page.md. Nothing else has to move.020-getting-started.md
serves /docs/zodoo/getting-started and renumbering never changes an address.
It does change relative links between pages, which is why the gaps exist./docs/<section>/<page> must
point at a page that is already live — not one that only exists on an
unmerged branch.bash <(curl -fsSL https://raw.githubusercontent.com/zebroo-tools/zodoo/refs/heads/main/install.sh)
cat << 'EOF' > /etc/sudoers.d/odoo Cmnd_Alias ODOO_COMMANDS_ODOO = /usr/bin/find *, /var/lib/zodoo_env/bin/odoo *, /usr/bin/btrfs subvolume *, /usr/bin/mkdir *, /usr/bin/mv *, /usr/bin/rsync *, /usr/bin/rm *, /usr/bin/du *, /usr/local/bin/odoo *, /usr/bin/btrfs subvol show *, /usr/sbin/gosu * odoo ALL=NOPASSWD:SETENV: ODOO_COMMANDS_ODOO EOF
odoo init <folder> cd <folder> odoo reload odoo -f db reset odoo up -d # now open browser on http://localhost
services: odoo3: labels: compose.merge: base-machine environment: WHAT YOU WANT volumes: WHAT YOU WANT
services: proxy: networks: network1: ipv4_address: 10.5.0.6 networks: network1: driver: bridge ipam: config: - subnet: 10.5.0.0/16
services: new_machine: ... labels: odoo_framework.apply_env: 0 # do not apply global environment from settings here
>odoo login>odoo build>odoo regpushREGISTRY=1 in settings and setup HUB_URL>odoo login>odoo regpullodoo backup odoo-db <path> (or default name used)
odoo restore odoo-db <path> (or select from list)
The commands above dump the database to a file. For continuous backup - base
backups plus WAL archive, point-in-time recovery, and a repository on a
different machine - use pgBackRest. It is off until switched on
(RUN_PGBACKREST), and register switches it on for you.
Setting a machine up against our backup server, in full:
odoo reload && odoo build
odoo pgbackrest register # files a request, then stops
# -> an admin approves it at
# https://enroll.backup.zebroo.de/
odoo pgbackrest register # collects certificate + passphrase
odoo reload && odoo up -d
odoo pgbackrest check # same version, certificate accepted, WAL arrives
odoo pgbackrest backup --type full
odoo pgbackrest info
Two calls with a human in between is deliberate: the passphrase cannot be replaced afterwards, so nothing is released until an admin has confirmed a second copy exists. Details, including what to do without a backup server, several projects on one machine, and recovery: docs/12-pgbackrest.md.
odoo pgactivity
| Setting | Description |
|---|---|
| PROJECT_NAME | Pasted into container names, postgres volumes and so on; please keep it as short as possible, as there are limits example docker containername 53 characters at time of writing |
| DBNAME | Uses projectname or a configured one |
| HUB_URL=value | user:password@host:port/paths.. to configure |
| REGISTRY=1 | Rewrites all build and images urls to HUB_URL. Should be used on production systems to force pull only from registry and block any local buildings. |
| POSTGRES_VERSION=13 | Choose from 11, 12, 13, 14 |
| ODOO_ENABLE_DB_MANAGER | Enables the odoo db manager |
| DEVMODE=1 | At restore runs safety scripts to disable cronjobs and mailserver and resets passwords |
| DEBUG_BROWSER=chrome|firefox|safari | Sets the browser used when launching a debug session (macOS only). If empty, auto-detects: prefers Chrome, then Firefox, then Safari. |
| RUN_PROXY=1 | If the built-in nodejs proxy is enabled |
| RUN_PROXY_PUBLISHED=0/1 | If the proxy is reachable from outside the docker network example from 127.0.0.1:8069 |
| PROXY_PORT | The port on which you can access with plain http the odoo |
| ODOO_IMAGES_BRANCH | The branch used for ~/.odoo/images |
| ODOO_INSTALL_LIBPOSTAL=1 | If set, then the libpostal lib is installed |
| ODOO_QUEUEJOBS_CHANNELS=root:40,magento2:1 | Configures queues for queuejob module (mandatory iff queue_job is installed in the project DB) |
| NAMED_ODOO_POSTGRES_VOLUME | Use a specific external volume; not dropped with down -v command |
CRONJOB_DADDY_CLEANUP=0 */1 * * * ${JOB_DADDY_CLEANUP} |
Turn on grandfather-principle based backup |
| RESTART_CONTAINERS=1 | Sets "restart unless-stopped" policy |
| ODOO_DEBUG_LOGLEVEL=info,error,debug | Loglevel for debug inside odoo container |
| APT_PROXY_IP= | Name/IP where to reach the apt-cacher on the host at buildtime from containers |
| RUN_APT_CACHER | if 1 then host apt cacher |
| UPDATE_STRATEGY | None--> update all modules of manifest['install'], 'odoo.sh' to update only changed modules by their version |
| NO_REMOVE_WEB_ASSETS_AFTER_RESTORE | 1-after restore web assets are not removed --no-remove-webassets" |
| ODOO_FILES_COMMON=1 | Share the attachment filestore of all instances on the host via hardlinks into filestore/_common (saves space, keeps each database's own GC checklist). Migrate legacy symlinks with odoo filestore unshare. |
| ZODOO_DEVMODE=1 | odoo setup upgrade fast-forwards the currently checked-out branch in ~/.odoo/images instead of jumping to the latest release tag. |
| ZODOO_ALPHA=1 | odoo setup upgrade tracks the alpha branch — opts in to the unstable feature channel (see "Alpha channel" below). Takes precedence over the latest-release-tag default; ZODOO_DEVMODE still wins. |
The alpha branch in this repo is the staging area for unstable / experimental features that are not yet ready for main. To opt your installation in:
# in ~/.odoo/settings
ZODOO_ALPHA=1After setting it, odoo setup upgrade switches ~/.odoo/images to the alpha branch and fast-forwards it on every upgrade (instead of jumping to the latest release tag). To leave the channel again, set ZODOO_ALPHA=0 and run odoo setup upgrade once — that puts you back on the latest semver tag.
Precedence:
ZODOO_DEVMODE=1 — pulls whatever branch you have checked out (wins over everything; for developers of zodoo itself)ZODOO_ALPHA=1 — git checkout alpha + fast-forward pullvX.Y.Z tagContents will be appended to [options] section of standard odoo configuration.
Configuration may simple look like:
setting1=value1
or like that:
[options]
setting1=value1
[queue_job]
settingqj=valueqj
The [options] is prepended automatically if missed.
To placed in project root.
The used odoo instance must be placed in /odoo.
{ "server-wide-modules": ["web", "field_onchange"], "python_version": "3.11.10", "version": 17.0, "upgrade_path": [paths to upgrade src of https://github.com/odoo/upgrade-utils], "odoo_dir": "odoo", # default "install": [...], "uninstall": ["web_tree_many2one_clickable", "helpdesk_create_in_new_tab"], "devmode_uninstall": ["password_security"], "tests": ["helpdesk_security", "visitreports"], "before-odoo-update": [["update", "make-sure", "stock_delivery"]], "addons_paths": ["odoo/odoo/addons", "odoo/addons", "enterprise", "addons_tools"], }
Put #odoo-require: crm,sale_stock in a line in your test
Put #odoo-uninstall: partner_autocomplete in a line in your test
The partner autocomplete nerves for example.
If you develop a strange external repository you can define a pre action scripts, that is executed before the reload and you can adapt some things.
EXTRA_CONFIG_your_key=value
These settings are added to the config files.
Best executed with:
time sudo -E pytestpipx runpip zodoo install line_profiler
$ZODOO_PYTHON -mkernprof -l -v odoo reloadWhen the Odoo container starts, the registry is loaded once per worker. The following parameters control how the application waits for Odoo to become ready and how it performs warmup requests to pre-fill caches.
The warmup logic:
| Variable | Default | Description |
|---|---|---|
INTERNAL_ODOO_PORT |
8069 |
Internal port where Odoo is exposed inside the container. Used to build the warmup URL. |
ODOO_WORKERS_WEB |
1 |
Number of Odoo web workers. Determines how many workers should be warmed up. |
MAX_WARMUP_WORKERS |
— | Optional override specifically for warmup worker count. If set, it takes precedence over ODOO_WORKERS_WEB. |
MAX_PARALLEL_WARMUP |
4 |
Maximum number of concurrent warmup HTTP requests to avoid overloading the system during startup. |
ODOO_READY_TIMEOUT_S |
60 |
Maximum time (in seconds) to wait for Odoo to become reachable. |
ODOO_READY_INTERVAL_S |
0.5 |
Polling interval (in seconds) while checking if Odoo is ready. |
ODOO_WARMUP_REQUESTS |
Number of workers | Total number of warmup requests to send. Defaults to the worker count to ensure each worker is initialized. |
ODOO_WARMUP_RETRIES |
3 |
Number of retry attempts per warmup request in case of transient failures. |
ODOO_REQUEST_TIMEOUT_S |
55 |
Timeout (in seconds) for each individual warmup HTTP request. |