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
198 changes: 0 additions & 198 deletions assets/oca_contributor.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Exhaustive config to contribute to OCA
# Place this file at ~/code/config.toml (or set TLC_CODE_DIR)

versions = ["18.0", "19.0"]

[tools]
uv = [
"copier",
Expand All @@ -12,196 +7,3 @@ uv = [
"odoo-addons-path"
]
system_packages = ["postgresql"]

[repos]
odoo = ["odoo"]
oca = [
# addons repositories
"account-analytic",
"account-budgeting",
"account-closing",
"account-consolidation",
"account-financial-reporting",
"account-financial-tools",
"account-fiscal-rule",
"account-invoice-reporting",
"account-invoicing",
"account-payment",
"account-reconcile",
"agreement",
"ai",
"apps-store",
"automation",
"bank-payment",
"bank-payment-alternative",
"bank-statement-import",
"brand",
"business-requirement",
"calendar",
"cim",
"commission",
"community-data-files",
"connector",
"connector-accountedge",
"connector-cmis",
"connector-ecommerce",
"connector-infor",
"connector-interfaces",
"connector-jira",
"connector-lengow",
"connector-lims",
"connector-magento",
"connector-odoo2odoo",
"connector-prestashop",
"connector-redmine",
"connector-sage",
"connector-salesforce",
"connector-spscommerce",
"connector-telephony",
"connector-woocommerce",
"contract",
"cooperative",
"credit-control",
"crm",
"crowdfunding",
"currency",
"data-protection",
"ddmrp",
"delivery-carrier",
"department",
"dms",
"donation",
"dotnet",
"e-commerce",
"e-learning",
"edi",
"edi-ediversa",
"edi-framework",
"edi-voxel",
"event",
"field-service",
"fleet",
"geospatial",
"helpdesk",
"hr",
"hr-attendance",
"hr-expense",
"hr-holidays",
"infrastructure",
"interface-github",
"intrastat-extrastat",
"iot",
"knowledge",
"l10n-brazil",
"l10n-france",
"l10n-usa",
"mail",
"maintenance",
"management-system",
"manufacture",
"manufacture-reporting",
"margin-analysis",
"mass-mailing",
"mis-builder",
"mis-builder-contrib",
"multi-company",
"odoo-pim",
"operating-unit",
"partner-contact",
"payroll",
"pms",
"pos",
"product-attribute",
"product-configurator",
"product-kitting",
"product-pack",
"product-variant",
"program",
"project",
"project-agile",
"project-reporting",
"purchase-reporting",
"purchase-workflow",
"pwa-builder",
"queue",
"repair",
"report-print-send",
"reporting-engine",
"resource",
"rest-api",
"rest-framework",
"rma",
"role-policy",
"sale-blanket",
"sale-channel",
"sale-financial",
"sale-prebook",
"sale-promotion",
"sale-reporting",
"sale-workflow",
"search-engine",
"server-auth",
"server-backend",
"server-brand",
"server-env",
"server-tools",
"server-ux",
"shift-planning",
"shopfloor-app",
"sign",
"social",
"spreadsheet",
"stock-logistics-availability",
"stock-logistics-barcode",
"stock-logistics-interfaces",
"stock-logistics-orderpoint",
"stock-logistics-putaway",
"stock-logistics-release-channel",
"stock-logistics-reporting",
"stock-logistics-request",
"stock-logistics-reservation",
"stock-logistics-shopfloor",
"stock-logistics-tracking",
"stock-logistics-transport",
"stock-logistics-warehouse",
"stock-logistics-workflow",
"stock-weighing",
"storage",
"survey",
"timesheet",
"vertical-abbey",
"vertical-agriculture",
"vertical-association",
"vertical-community",
"vertical-construction",
"vertical-cooperative-supermarket",
"vertical-edition",
"vertical-education",
"vertical-hotel",
"vertical-isp",
"vertical-medical",
"vertical-ngo",
"vertical-realestate",
"vertical-rental",
"vertical-travel",
"wallet",
"web",
"web-api",
"web-api-contrib",
"webhook",
"webkit-tools",
"website",
"website-cms",
"website-themes",
"wms",
# exceptions, new repositories
["oca-custom", ["18.0"]],
["tier-validation", ["19.0"]],
# tooling
["oca-ci", ["master"]],
["oca-github-bot", ["master"]],
["oca-port", ["main"]],
["odoo-module-migrator", ["master"]],
]
camptocamp = ["odoo-cloud-platform"]
forgeflow = ["stock-rma"]
9 changes: 9 additions & 0 deletions trobz_local/assets/oca_contributor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tools]
uv = [
"copier",
"oca-port",
"odooly",
"odoo-venv",
"odoo-addons-path"
]
system_packages = ["postgresql"]
34 changes: 0 additions & 34 deletions trobz_local/assets/odoo_dev.toml

This file was deleted.

10 changes: 10 additions & 0 deletions trobz_local/assets/odoo_minimal.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Minimal config to set up latest Odoo for development
# Place this file at ~/code/config.toml (or set TLC_CODE_DIR)

versions = ["18.0"]

[tools]
uv = ["odoo-venv", "odoo-addons-path"]

[repos]
odoo = ["odoo"]
50 changes: 50 additions & 0 deletions trobz_local/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import subprocess
import urllib.request
from enum import Enum
from importlib.resources import files
from pathlib import Path
from typing import Annotated

Expand Down Expand Up @@ -66,6 +69,53 @@ def main(
_run_init(ctx)


ALL_REPOS_URL = "https://raw.githubusercontent.com/trobz/odoo-addons-repos/main/all_repos_all_versions.toml"

_ASSETS = files("trobz_local").joinpath("assets")


class ConfigProfile(str, Enum):
odoo_minimal = "odoo-minimal"
oca_contributor = "oca-contributor"


@app.command()
def generate_config(
ctx: typer.Context,
profile: Annotated[ConfigProfile, typer.Argument(help="Configuration profile to generate.")],
):
"""Generate a config.toml file from a predefined profile."""
code_root = get_code_root()
config_path = code_root / "config.toml"

if config_path.exists() and ctx.obj.get("newcomer", True):
typer.secho(f"Config file already exists: {config_path}", fg=typer.colors.YELLOW)
if not typer.confirm("Overwrite?", default=False):
raise typer.Abort()

if profile == ConfigProfile.odoo_minimal:
content = (_ASSETS / "odoo_minimal.toml").read_text()
else:
content = _build_oca_contributor_config()

code_root.mkdir(parents=True, exist_ok=True)
config_path.write_text(content)
typer.secho(f"Config written to {config_path}", fg=typer.colors.GREEN)


def _build_oca_contributor_config() -> str:
typer.echo(f"Fetching OCA repo list from {ALL_REPOS_URL} ...")
try:
with urllib.request.urlopen(ALL_REPOS_URL, timeout=30) as resp: # noqa: S310
remote_content = resp.read().decode()
except Exception as e:
typer.secho(f"Failed to fetch repo list: {e}", fg=typer.colors.RED)
raise typer.Exit(code=1) from e

local_content = (_ASSETS / "oca_contributor.toml").read_text()
return remote_content + "\n" + local_content


@app.command()
def init(ctx: typer.Context):
_run_init(ctx)
Expand Down
7 changes: 2 additions & 5 deletions trobz_local/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import platform
import re
import shutil
from importlib.resources import files
from pathlib import Path

import git
Expand Down Expand Up @@ -233,11 +232,9 @@ def get_uv_path():


def show_config_instructions():
content = files("trobz_local").joinpath("assets/odoo_dev.toml").read_text()
typer.secho("Config file not found.", fg=typer.colors.YELLOW)
code_root = get_code_root()
typer.echo(f"Please create {code_root}/config.toml with content like this:")
typer.echo(content)
typer.echo("Generate one with: tlc generate-config <profile>")
typer.echo("Available profiles: odoo-minimal, oca-contributor")


def get_config():
Expand Down
Loading