[FIX] odoo20: install inotify package for --dev=reload autoreload

Odoo 20's requirements.txt no longer ships the inotify python package,
so --dev=reload logged "'inotify' module not installed. Code autoreload
feature is disabled" and never restarted on file edits — breaking the
core promise of this blueprint (live edits auto-apply).

The init script now pip-installs inotify unconditionally after the
requirements install (cheap no-op when already present).
This commit is contained in:
1b-agent committed 2026-11-10 14:54:53 +00:00
1 parent b2e1d1d3d5
commit 6254f04fe7
4 files changed
+25

No files matched your search

+3
View File
@@ -23,6 +23,9 @@ blueprint (battle-tested Sep 2026 on Odoo 19) — same architecture, retargeted:
> force-resets it when empty), and the legacy `xmlrpc_port` key no longer > force-resets it when empty), and the legacy `xmlrpc_port` key no longer
> exists — without this fix Odoo binds loopback only and every request from > exists — without this fix Odoo binds loopback only and every request from
> Traefik/the swarm VIP dies with `connection refused` → HTTP 502. > Traefik/the swarm VIP dies with `connection refused` → HTTP 502.
> The init script also installs the `inotify` python package: Odoo 20's
> `requirements.txt` no longer ships it, and `--dev=reload` silently
> disables code autoreload without it.
```bash ```bash
python3 deploy.py prepare # regenerates easypanel.schema.json, inline.Dockerfile, init-odoo.sh, .db_password python3 deploy.py prepare # regenerates easypanel.schema.json, inline.Dockerfile, init-odoo.sh, .db_password
+10
View File
@@ -116,6 +116,10 @@ def build_init_script() -> str:
defaults `http_interface` to 127.0.0.1 AND force-resets it to defaults `http_interface` to 127.0.0.1 AND force-resets it to
127.0.0.1 when empty, so without the explicit line Odoo binds 127.0.0.1 when empty, so without the explicit line Odoo binds
loopback only and Traefik/VIP connections are refused (502). loopback only and Traefik/VIP connections are refused (502).
* CRITICAL FIX #5 (Odoo 20): install the `inotify` python package.
Odoo 20's requirements.txt no longer ships it, but `--dev=reload`
requires it — without it odoo logs "'inotify' module not installed.
Code autoreload feature is disabled" and NEVER restarts on edits.
""" """
return textwrap.dedent(r""" return textwrap.dedent(r"""
#!/bin/bash #!/bin/bash
@@ -154,6 +158,12 @@ def build_init_script() -> str:
echo "[init] Odoo already installed; skipping pip install." echo "[init] Odoo already installed; skipping pip install."
fi fi
# Odoo 20: requirements.txt no longer ships the inotify package, but
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
# feature is disabled"). Install unconditionally (cheap if present).
pip install --quiet --no-cache-dir --break-system-packages inotify \
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
cat > /etc/odoo/odoo.conf <<EOF cat > /etc/odoo/odoo.conf <<EOF
[options] [options]
+6
View File
@@ -34,6 +34,12 @@ else
echo "[init] Odoo already installed; skipping pip install." echo "[init] Odoo already installed; skipping pip install."
fi fi
# Odoo 20: requirements.txt no longer ships the inotify package, but
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
# feature is disabled"). Install unconditionally (cheap if present).
pip install --quiet --no-cache-dir --break-system-packages inotify \
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
cat > /etc/odoo/odoo.conf <<EOF cat > /etc/odoo/odoo.conf <<EOF
[options] [options]
+6
View File
@@ -36,6 +36,12 @@ else
echo "[init] Odoo already installed; skipping pip install." echo "[init] Odoo already installed; skipping pip install."
fi fi
# Odoo 20: requirements.txt no longer ships the inotify package, but
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
# feature is disabled"). Install unconditionally (cheap if present).
pip install --quiet --no-cache-dir --break-system-packages inotify \
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
cat > /etc/odoo/odoo.conf <<EOF cat > /etc/odoo/odoo.conf <<EOF
[options] [options]