← ClaudeAtlas

odoo-worktreelisted

Isolated feature development for a LIVE Odoo dev environment using git worktree — build/test on the running instance while committing to a clean branch cut from production, without touching prod or the active dev branch. Use whenever a feature must not land on the current dev/uat branch yet (pending approval/training), when the Odoo container mounts the main working tree (so you can't just switch branches), when syncing changes between a worktree branch and the live working copy, or when packaging ORM-created records into an addon that must install identically on a clean DB (post_init_hook adopt-vs-create + clean-install test ritual).
tuanle96/odoo-ai-skills · ★ 4 · AI & Automation · score 62
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