Skip to content

feat: improve --project-dir with verbose, launcher, and version detection#65

Draft
nilshamerlinck wants to merge 7 commits intomainfrom
feat/verbose-odoo-addons-path
Draft

feat: improve --project-dir with verbose, launcher, and version detection#65
nilshamerlinck wants to merge 7 commits intomainfrom
feat/verbose-odoo-addons-path

Conversation

@nilshamerlinck
Copy link
Copy Markdown
Contributor

Summary

  • Pass --verbose flag through to odoo-addons-path detection functions
  • Auto-create launcher when --project-dir is used, with dynamic addons-path resolution via odoo-addons-path at startup
  • Support custom launcher names via --create-launcher=<name> (defaults to project dir name)
  • Fix version detection in fallback layouts by using get_odoo_version (manifest-based fallback)
  • Fix launcher using absolute paths for PROJECT_DIR and passing --odoo-dir

Notes

  • Requires unreleased odoo-addons-path>=1.2.0 (tmp uv source override included, to be removed before merge)
  • Companion fix in odoo-addons-path: trobz/odoo-addons-path@feat/version-detection

Test plan

  • odoo-venv create --verbose --project-dir=. in a fallback layout project
  • Verify generated launcher resolves full addons path (odoo base + project addons)
  • --create-launcher=custom-name produces odoo-v{major}-custom-name
  • Launcher works from any directory (absolute paths)

🤖 Generated with Claude Code

nilshamerlinck and others added 6 commits March 18, 2026 18:40
When --verbose is used, forward it to detect_codebase_layout and
get_addons_path so users get detailed output from project layout detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ject-dir

When --project-dir is used, the launcher is now created automatically.
The generated launcher runs `odoo-addons-path` at startup to dynamically
resolve addons paths from the project directory, unless ADDONS_PATH is
explicitly configured in the launcher script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When --project-dir detects the Odoo version but no odoo_dir (e.g.
fallback layout without Odoo source), the resolved version was not
considered for building the default ~/code/odoo/odoo/{version} path,
causing a misleading "ODOO_VERSION is required" error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
_detect_project_layout only used get_odoo_version_from_release which
requires an odoo_dir. In fallback layouts (no Odoo source in project),
the version was never detected despite odoo-addons-path printing it
in verbose mode. Now uses get_odoo_version which falls back to inferring
the version from addon manifests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
--create-launcher now accepts an optional name (e.g. --create-launcher=myproject)
to generate odoo-v{major}-{name} instead of the default odoo-v{major}.
When --project-dir is used, the launcher is auto-named from the project
directory name. Use --create-launcher=auto to explicitly trigger auto-naming.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s detection

Two fixes for the generated launcher:
- PROJECT_DIR was stored as a relative path (e.g. "."), making the
  launcher only work from the project directory. Now resolved to absolute.
- odoo-addons-path was called without --odoo-dir, so the base Odoo
  addons folder was missing from the resolved addons path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nilshamerlinck nilshamerlinck force-pushed the feat/verbose-odoo-addons-path branch from 1ccd91d to 6591e8b Compare March 19, 2026 03:58
To be removed once odoo-addons-path>=1.2.0 is published on PyPI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nilshamerlinck nilshamerlinck force-pushed the feat/verbose-odoo-addons-path branch from 6591e8b to e6c9b8c Compare March 19, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant