Version-aware Odoo development for the Pi coding agent.
Guarantees the Odoo version is known before any line of Odoo code is written.
A version-aware Odoo development extension for the Pi coding agent.
It guarantees that the Odoo version is known before any Odoo code is written, then redirects the agent to the official Odoo docs, ORM changelog, and OCA migration guide for the confirmed major (it does not try to maintain a hand-curated change list — Odoo changes too much per release). Supports Odoo 14–19.
This complements Odoo knowledge skills (odoo-19, odoo-code-review, …): those provide knowledge, this extension enforces runtime version awareness.
Writing Odoo code without confirming the major version leads to subtle bugs — Odoo changes a lot between releases (view tags, removed fields, ORM API shifts, security model changes, …). Rather than hardcoding a partial change list, this extension makes the agent stop and confirm the version first, then point at the official changelog and docs for that major.
- Strict gate (two steps): blocks
write/editon Odoo code files (.py/.xml/.csv/.po/.potinside a module with a__manifest__.py) until BOTH conditions hold: (1) a version is confirmed, AND (2) the agent has researched the official sources for that major in the current session (viaodoo_changelogorodoo_versionwithdetect). This guarantees every proposed change is grounded in the version's official changelog/docs before it is written. - Docker lifecycle commands: manage your Odoo instance directly from Pi.
/odoo-status: Show Odoo project status, version gate state, and active Docker service./odoo-restart: Restart the Odoo service./odoo-update <modules>: Update Odoo modules (-u)./odoo-logs: Tail the Odoo service logs.
- Auto-detection of the Odoo version from multiple sources (Docker Compose first).
- Official-sources router: once a version is known, the system prompt gets the official docs, ORM changelog, and OCA migration-guide URLs for that major.
- No-op outside Odoo projects: safe to load anywhere.
For write/edit on an Odoo code file (per session):
- No version confirmed → blocked. Run
/odoo-version(or/odoo-version set <major>) or callodoo_version. - Version confirmed, but not researched this session → blocked. Call
odoo_changelog(recommended) orodoo_version { action: "detect" }so the change is grounded in the version's official changelog. - Version confirmed AND researched → writes allowed (for the rest of the session; re-detection after
/odoo-version clearre-arms the gate).
The .pi/ directory is always exempt, so /odoo-version set can always write its config.
# From npm (shows up in the pi.dev gallery)
pi install npm:pi-odoo-develop
# From GitHub
pi install git:github.com/vigbe/pi-odoo-develop
# Try it in the current project only (no install)
pi -e ./src/index.tsIt is distributed as a Pi package — see package.json (pi manifest key).
/odoo-version # show the detected version + source
/odoo-version detect # force re-detection
/odoo-version set 17 # manual override (saved to .pi/odoo.json)
/odoo-version clear # remove the override
Manage your Odoo instance directly from the Pi console:
/odoo-status # Show gate state, version, and Docker status
/odoo-restart # Restart the Odoo service
/odoo-update all # Update all modules
/odoo-update sale,stock # Update specific modules (-d dbname optional)
/odoo-logs --tail=50 # Show the last 50 lines of logs
The extension automatically finds your Odoo service in docker-compose.yml (prioritizing services named odoo or web).
The agent should call this before writing or reviewing Odoo code:
odoo_version { action: "detect" } # auto-detect
odoo_version { action: "show" } # read cached
odoo_version { action: "set", version: "17" } # manual override
Returns the confirmed major and the official docs, ORM changelog, and OCA migration-guide URLs for it.
Fetches the official Odoo ORM changelog for the confirmed major on demand, so the agent can apply version-correct APIs straight from the source of truth (no manual change list to maintain):
odoo_changelog {} # changelog for the detected major
odoo_changelog { major: 17 } # changelog for a specific major
For Odoo 14/15 (which have no dedicated changelog page), it falls back to the OCA migration guide for that major, with a note explaining the fallback.
Sources are tried in priority order; the first success is cached to .pi/odoo.json:
- Manual override (
.pi/odoo.jsonwithsource: "manual") — always honoured. - Docker Compose runtime:
docker compose exec <odoo-service> python -c "import odoo.release; print(odoo.release.version)". - Docker image tag:
image: odoo:17.0parsed fromdocker compose config. - Repo source:
./odoo-bin --versionorodoo/release.py. - base manifest:
versionfield inbase/__manifest__.py.
Detection runs automatically once per session when the agent starts in an Odoo project. A manual override is never overwritten by automatic detection.
14, 15, 16, 17, 18, 19. Unknown/future majors degrade gracefully: detection still works and the gate lifts, but no version-specific banner is injected.
| File | Purpose |
|---|---|
.pi/odoo.json |
Cached/manual version override, written by the extension. |
Interactive shell support:
/odoo-shell—docker compose exec <svc> odoo shell
Run unit tests locally using the Node.js test runner:
npm testLGPL-3.0-or-later