feat: improve --project-dir with verbose, launcher, and version detection#65
Draft
nilshamerlinck wants to merge 7 commits intomainfrom
Draft
feat: improve --project-dir with verbose, launcher, and version detection#65nilshamerlinck wants to merge 7 commits intomainfrom
nilshamerlinck wants to merge 7 commits intomainfrom
Conversation
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>
1ccd91d to
6591e8b
Compare
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>
6591e8b to
e6c9b8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--verboseflag through toodoo-addons-pathdetection functions--project-diris used, with dynamic addons-path resolution viaodoo-addons-pathat startup--create-launcher=<name>(defaults to project dir name)get_odoo_version(manifest-based fallback)PROJECT_DIRand passing--odoo-dirNotes
odoo-addons-path>=1.2.0(tmp uv source override included, to be removed before merge)Test plan
odoo-venv create --verbose --project-dir=.in a fallback layout project--create-launcher=custom-nameproducesodoo-v{major}-custom-name🤖 Generated with Claude Code