odoo-worktreelisted
Install: claude install-skill tuanle96/odoo-ai-skills
# Odoo + git worktree — develop hot, commit cold
The core tension: the **dev instance mounts the main working tree** (docker
`addons_path` → the repo checkout), so you cannot switch branches without
breaking the running registry — but the feature must stay off both
`production` and the active dev branch (`uat`) until it is approved.
**The pattern: the main tree stays on the dev branch and RUNS the code as
uncommitted files; a git worktree holds a clean feature branch cut from
production and RECEIVES the same changes as commits.**
```
repo/ ← main worktree, branch uat (env mounts this)
│ my_addon/ (untracked — live code the container executes)
│ other_addon/x.py (modified — your surgical fix)
└── .worktrees/feature-x/ ← second worktree, branch feature/x ← production
my_addon/ (committed)
```
## Setup
```bash
git fetch origin production
git worktree add .worktrees/feature-x -b feature/x origin/production
```
- `.worktrees/` inside the repo is fine: Odoo's `addons_path` does **not**
scan recursively, so the copies do not shadow the live addons
(`odoo-ai preflight <module>` confirms: 0 shadow warnings).
- **Submodule gotcha:** `git worktree add` does NOT checkout submodules. If
`addons_path` lists a submodule dir (often *first*), a container pointed at
the worktree will half-load: run
`git -C .worktrees/feature-x submodule update --init <submodule>`.
- Removing a worktree later (`git worktree remove`) does not de