Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion src/rodoo/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ def start(
),
python_version: Optional[str] = typer.Option(None, "--python", "-py"),
db: Optional[str] = typer.Option(None, "--db", "-d", help="Database name"),
path: Optional[str] = typer.Option(
None, "--path", help="Path to Odoo modules, comma-separated."
),
force_install: Optional[bool] = typer.Option(
None, "--force-install", help="Force reinstallation of Python dependencies."
),
force_update: Optional[bool] = typer.Option(
None, "--force-update", help="Force update of Odoo sources."
),
):
"""Running Odoo instance"""
args = {k: v for k, v in locals().items() if k != "profile" and v is not None}
Expand All @@ -57,6 +66,15 @@ def upgrade(
),
python_version: Optional[str] = typer.Option(None, "--python", "-py"),
db: Optional[str] = typer.Option(None, "--db", "-d", help="Database name"),
path: Optional[str] = typer.Option(
None, "--path", help="Path to Odoo modules, comma-separated."
),
force_install: Optional[bool] = typer.Option(
None, "--force-install", help="Force reinstallation of Python dependencies."
),
force_update: Optional[bool] = typer.Option(
None, "--force-update", help="Force update of Odoo sources."
),
):
"""
Running update Odoo and exist
Expand Down Expand Up @@ -84,6 +102,15 @@ def test(
),
python_version: Optional[str] = typer.Option(None, "--python", "-py"),
db: Optional[str] = typer.Option(None, "--db", "-d", help="Database name"),
path: Optional[str] = typer.Option(
None, "--path", help="Path to Odoo modules, comma-separated."
),
force_install: Optional[bool] = typer.Option(
None, "--force-install", help="Force reinstallation of Python dependencies."
),
force_update: Optional[bool] = typer.Option(
None, "--force-update", help="Force update of Odoo sources."
),
):
"""
Running tests
Expand Down Expand Up @@ -111,6 +138,15 @@ def shell(
),
python_version: Optional[str] = typer.Option(None, "--python", "-py"),
db: Optional[str] = typer.Option(None, "--db", "-d", help="Database name"),
path: Optional[str] = typer.Option(
None, "--path", help="Path to Odoo modules, comma-separated."
),
force_install: Optional[bool] = typer.Option(
None, "--force-install", help="Force reinstallation of Python dependencies."
),
force_update: Optional[bool] = typer.Option(
None, "--force-update", help="Force update of Odoo sources."
),
):
"""
Running Odoo shell
Expand Down Expand Up @@ -140,14 +176,24 @@ def translate(
),
python_version: Optional[str] = typer.Option(None, "--python", "-py"),
db: Optional[str] = typer.Option(None, "--db", "-d", help="Database name"),
path: Optional[str] = typer.Option(
None, "--path", help="Path to Odoo modules, comma-separated."
),
force_install: Optional[bool] = typer.Option(
None, "--force-install", help="Force reinstallation of Python dependencies."
),
force_update: Optional[bool] = typer.Option(
None, "--force-update", help="Force update of Odoo sources."
),
):
"""
Export translation file for a module
"""
args = {
k: v
for k, v in locals().items()
if k not in ["profile", "language"] and v is not None
if k not in ["profile", "language", "force_install", "force_update"]
and v is not None
}
config = process_cli_args(profile, args)
runner = construct_runner(config, args)
Expand Down
5 changes: 5 additions & 0 deletions src/rodoo/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def _parse_cli_params(args: dict) -> dict:
if val is not None:
if arg == "module":
cli_params["modules"] = [m.strip() for m in val.split(",")]
elif arg == "path":
cli_params["paths"] = [p.strip() for p in val.split(",")]
elif arg != "profile":
cli_params[arg] = val
return cli_params
Expand Down Expand Up @@ -221,6 +223,9 @@ def process_cli_args(profile: Optional[str], args: dict) -> dict:
Output.error("No Odoo modules/version specified to run Odoo")
raise typer.Exit(1)

if not config.get("paths"):
config["paths"] = [str(Path.cwd())]

return config


Expand Down
Loading