gOdoo-cli 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/PKG-INFO +1 -1
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/pyproject.toml +1 -1
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/setup.py +1 -1
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/__init__.py +1 -1
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/launch.py +8 -9
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/importer.py +13 -14
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/git_repo.py +8 -4
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/LICENSE +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/README.md +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/__main__.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/cli.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/__init__.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/bootstrap.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/config.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/__init__.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/cli.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/cli_callbacks.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/modules.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/rpc/translations.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/shell.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/source_get.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/commands/test.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/__init__.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/git_odoo.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/git_odoo_addons.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/git_url.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/git/zip_download.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/__init__.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/bootstrap.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/cli.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/odoo_files.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/odoo_manifest.py +0 -0
- {godoo_cli-0.3.3 → godoo_cli-0.3.4}/src/godoo_cli/helpers/system.py +0 -0
|
@@ -40,7 +40,7 @@ entry_points = \
|
|
|
40
40
|
|
|
41
41
|
setup_kwargs = {
|
|
42
42
|
'name': 'godoo-cli',
|
|
43
|
-
'version': '0.3.
|
|
43
|
+
'version': '0.3.4',
|
|
44
44
|
'description': 'Wrapper around Odoo-Bin with some convinience RPC functions.',
|
|
45
45
|
'long_description': '# gOdoo Dev Environment\n\n\n\n\n[<img src="https://raw.githubusercontent.com/OpenJKSoftware/gOdoo/main/assets/godoo-main-cli.png" width="1000"/>](image.png)\n\n**gOdoo** is short for **go Odoo**. \\\nIt is a [Vscode Devcontainer](https://code.visualstudio.com/docs/remote/containers) Environment for [Odoo](https://odoo.com/)\nwith Python CLI `godoo` convenience wrapper around `odoo-bin`.\n\nThis repository is the base source for the Python package [godoo-cli](https://pypi.org/project/godoo-cli/) and serves as\nan all batteries included development environment.\n\nMade Possible by: [WEMPE Elektronic GmbH](https://wetech.de)\n\n# gOdoo-cli\n\nPython package that provides `godoo` command line interface around `odoo-bin`.\n\nIt\'s build with [Typer](https://github.com/tiangolo/typer) to provide some convenience Wrappers for Odoo development and\nDeployment.\n\nMost flags can be configured by Env variables. \\\nUse `godoo --help` to find out more. HINT: Install tab-completion with `godoo --install-completion`\n\n# Docker\n\nThis workspace also contains Docker and Docker-Compose files. \\\n\nThey are used to provide either easy Odoo instances where the source is pulled according to\n[ODOO_MANIFEST.yml](./ODOO_MANIFEST.yml), or as a all batteries included devcontainer for VScode.\n\n## Requirements\n\n- [Docker Compose](https://github.com/docker/compose)\n- [Traefik](https://doc.traefik.io/traefik/) container running with docker provider and "traefik" named docker network.\n Example: [Traefik Devproxy](https://github.com/joshkreud/traefik_devproxy)\n- SSH Agent running. (check `echo $SSH_AUTH_SOCK`)\\\n This gets passed trough in the Buildprocess to clone Thirdparty repos.\n\n## Just wanna have a quick and easy Odoo Instance?\n\n```bash\ngit clone https://github.com/OpenJKSoftware/gOdoo\ncd godoo\n. scripts/container_requirements.sh # Check Requirements\ndocker-compose build\ndocker-compose up\n# wait......\n# wait a bit mode ...\n# just a little bit longer ..\n# There we go.\n# Odoo should be reachable on \'https://godoo.docker.localhost\' assuming you didn\'t change .env TRAEFIK_HOST_RULE or COMPOSE_PROJECT_NAME\n```\n\n# Devcontainer\n\n## Features\n\n- All batteries included [Devcontainer](https://code.visualstudio.com/docs/remote/containers) with postgres service\n Container and local DNS resolvig managed by [Traefik](https://doc.traefik.io/traefik/).\n- Easy fully working Odoo instance by `docker-compose up` with https access.\n- `godoo` CLI wrapper around Odoo. (Most flags can be configured by Environment Variables and are already preconfigured\n in the Containers. See [.env.sample](./.env.sample))\n- `odoo-bin` is added to PATH and can thus be invoked from every folder.\n- Odoo will run in Proxy_Mode behind a Traefik reverse proxy for easy access on\n `https://$COMPOSE_PROJECT_NAME.docker.localhost`\n- [Odoo Pylint plugin](https://github.com/OCA/pylint-odoo) preconfigured in vscode\n- Preinstalled vscode Extensions Highlights:\n - [SQL Tools](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools) with preconfigured connection for\n easy Database access in the Sidebar.\n - [Docker Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) controls\n container host.\n - [Odoo Snippets](https://marketplace.visualstudio.com/items?itemName=mstuttgart.odoo-snippets)\n - [Odoo Developments](https://marketplace.visualstudio.com/items?itemName=scapigliato.vsc-odoo-development) can Grab\n Odoo Model information from a running Server\n - [Todo Tree](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree)\n\n## Usage\n\n1. For Docker on windows: Clone the repo into the WSL2 Filesystem for better IO performance\n2. Have [Traefik](https://github.com/traefik/traefik) Running on `docker.localhost`\n [Example](https://github.com/joshkreud/traefik_devproxy) \\\n There must be a Docker network called `traefik` that can reach traefik.\n3. Open Devcontianer:\n - If you have the Devcontainer CLI: `devcontainer open .`\n - If not open the workspace in Local Vscode. In the Command pallete search for `Reopen in container`\n4. From **within the container** start Odoo using one of the following commands:\n - You can enable godoo tab-completion by `godoo --install-completion`\n - `make` -> Loads Odoo + Workspace Addons\n - `make bare` -> Loads Odoo with ony `web` installed.\n - `make kill` -> Search for `odoo-bin` processes and kill them\n - `make reset` -> Drops DB, deletes config file and datafolder\n - The full init script is available via "`godoo`". (See --help for Options)\n5. Open Odoo `https://$COMPOSE_PROJECT_NAME.docker.localhost`\\\n For example `COMPOSE_PROJECT_NAME=godoo` --> [https://godoo.docker.localhost](https://godoo.docker.localhost)\n6. Login with `admin:admin`\n7. Profit!\n\n### Access to Odoo and Thirdparty addon Source\n\nYou can access the Odoo source by opening the VsCode workspace [full.code-workspace](full.code-workspace) from within\nthe Container. This will open a [Multi-Root Workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces).\nReally waiting for https://github.com/microsoft/vscode-remote-release/issues/3665 here.\n\n## Reset Devcontainer Data\n\nWhen you screwed up so bad its time to just start Over godoo has you covered:\n\n### Automatic Reset\n\nThere are 3 Options to reset the Dev Env.\n\n1. From **Outside** the Container run `make reset` in the project root to delete docker volumes and restart the\n container. (Vscode will prompt to reconnect if still open)\n2. From **Outside** the Container run `make reset-hard` in the project root to force rebuild the main Odoo container and\n then do the same as `make reset`\n3. From **Inside** the Container run `make reset` to drop the DB and delete varlib and the bootstrap flag, which is way\n quicker than the other options.\n\n### Manual Reset\n\n1. Close vscode\n2. Remove `app` and `db` container from docker.\n3. Remove volumes: `db, odoo_thirdparty, odoo_web, vscode_extensions`\n4. Restart Devcontainer\n\n## Python Debugging\n\n### VsCode Debugging\n\nDebugging doesn\'t reliably work with\n[Odoo Multiprocess](https://www.odoo.com/documentation/14.0/developer/misc/other/cmdline.html#multiprocessing) mode\nenabled. \\\nThe container ships with a Vscode Debug profile, that sets `--workers 0` to allow for Debugging Breakpoints. See [.vscode/launch.json](./.vscode/launch.json)\n\n### Interactive Shell\n\nUse `godoo shell` to enter an interactive shell on the Database.\n\n# Odoo Modules\n\n## Third Party Modules (manifest.yml)\n\nThe `godoo` bootstrap function, will download some modules using git. \\\nWhich Repos to download is specified in `ODOO_MANIFEST.yml` ([Default](./ODOO_MANIFEST.yml)) \\\nNot all of the cloned addons are automatically installed. \\\nInstall them via the Apps Page in Odoo using `godoo rpc modules install` or using `odoo-bin`.\\\nModules downloaded on the Odoo Marketplace can be dropped as a `.zip` archive in [./thirdparty](./thirdparty)\n',
|
|
46
46
|
'author': 'Joshua Kreuder',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.3.
|
|
1
|
+
__version__ = "0.3.4"
|
|
2
2
|
from .cli import launch_cli
|
|
@@ -116,15 +116,14 @@ def launch_odoo(
|
|
|
116
116
|
rpc_callback(ctx) # Add RPC Options using Defaults and Envvars
|
|
117
117
|
|
|
118
118
|
if load_data_path:
|
|
119
|
-
for
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
loader_thread.start()
|
|
119
|
+
LOGGER.info("Starting Data Importer Thread for: '%s'", ", ".join(map(str, load_data_path)))
|
|
120
|
+
loader_thread = threading.Thread(
|
|
121
|
+
target=import_to_odoo,
|
|
122
|
+
name="DataLoader",
|
|
123
|
+
args=(ctx,),
|
|
124
|
+
kwargs={"read_paths": load_data_path},
|
|
125
|
+
)
|
|
126
|
+
loader_thread.start()
|
|
128
127
|
|
|
129
128
|
cmd_string = _launch_command(
|
|
130
129
|
odoo_path=ctx.obj.odoo_main_path,
|
|
@@ -6,6 +6,7 @@ Places Systemparam to Track if import was already done.
|
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
8
|
from pathlib import Path
|
|
9
|
+
from typing import List
|
|
9
10
|
|
|
10
11
|
import typer
|
|
11
12
|
from godoo_rpc import import_data
|
|
@@ -21,7 +22,7 @@ LOGGER = logging.getLogger(__name__)
|
|
|
21
22
|
@typer_unpacker
|
|
22
23
|
def import_to_odoo(
|
|
23
24
|
ctx: typer.Context,
|
|
24
|
-
|
|
25
|
+
read_paths: List[Path] = typer.Argument(
|
|
25
26
|
...,
|
|
26
27
|
readable=True,
|
|
27
28
|
exists=True,
|
|
@@ -53,18 +54,16 @@ def import_to_odoo(
|
|
|
53
54
|
odoo_user=ctx.obj.odoo_rpc_user,
|
|
54
55
|
odoo_password=ctx.obj.odoo_rpc_password,
|
|
55
56
|
)
|
|
56
|
-
if not read_path.exists():
|
|
57
|
-
raise ValueError("Provided import Path: %s doesn't exist", read_path)
|
|
58
57
|
|
|
59
|
-
if
|
|
60
|
-
|
|
61
|
-
file_regex = ""
|
|
58
|
+
if missing_paths := [p for p in read_paths if not p.exists()]:
|
|
59
|
+
raise ValueError("Provided import Paths: %s doesn't exist", ", ".join(missing_paths))
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
for path in read_paths:
|
|
62
|
+
import_data(
|
|
63
|
+
odoo_api=odoo_api,
|
|
64
|
+
read_path=path.absolute(),
|
|
65
|
+
data_regex=file_regex,
|
|
66
|
+
product_image_regex="" if path.is_file() else product_image_regex,
|
|
67
|
+
check_dataset_timestamp="" if path.is_file() else check_data_timestamp,
|
|
68
|
+
skip_existing_ids=skip_existing_ids,
|
|
69
|
+
)
|
|
@@ -55,9 +55,12 @@ def git_pull_checkout_reset(
|
|
|
55
55
|
pull : str, optional
|
|
56
56
|
specific target to pull. Usually used in conjunction with branch.
|
|
57
57
|
reset_hard : bool, optional
|
|
58
|
-
will call reset --hard
|
|
58
|
+
will call reset --hard before checkout to ensure clean git repo, by default True
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
|
+
if reset_hard:
|
|
62
|
+
repo.git.reset("--hard", "HEAD")
|
|
63
|
+
|
|
61
64
|
if pull:
|
|
62
65
|
LOGGER.debug("Pulling Repo: %s, %s", repo.working_dir, pull)
|
|
63
66
|
try:
|
|
@@ -78,8 +81,6 @@ def git_pull_checkout_reset(
|
|
|
78
81
|
if branch:
|
|
79
82
|
LOGGER.debug("Checking Out repo %s to Branch: %s", repo.git_dir, branch)
|
|
80
83
|
repo.git.checkout(branch)
|
|
81
|
-
if reset_hard:
|
|
82
|
-
repo.git.reset("--hard")
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
def git_ensure_ref(
|
|
@@ -120,7 +121,10 @@ def git_ensure_ref(
|
|
|
120
121
|
|
|
121
122
|
if not pull and branch and not commit:
|
|
122
123
|
remote_name = str(repo.remotes[0].name)
|
|
123
|
-
|
|
124
|
+
try:
|
|
125
|
+
remote_commit = repo.git.rev_parse(remote_name + "/" + str(branch))
|
|
126
|
+
except Exception:
|
|
127
|
+
remote_commit = "unknown"
|
|
124
128
|
LOGGER.debug(
|
|
125
129
|
"Repo: %s comparing local head '%s' with remote head '%s'", repo.working_dir, current, remote_commit
|
|
126
130
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|