Skip to main content

Wrapper around Odoo-Bin with some convinience RPC functions.

Project description

gOdoo Dev Environment

OdooLogo ComposeLogo

gOdoo is short for go Odoo.
It is a Vscode Devcontainer Environment for Odoo with Python CLI godoo convenience wrapper around odoo-bin.

This repository is the base source for the Python package godoo-cli and serves as an all batteries included development environment.

Made Possible by: WEMPE Elektronic GmbH

gOdoo-cli

Python package that provides godoo command line interface around odoo-bin.

It's build with Typer to provide some convenience Wrappers for Odoo development and Deployment.

Most flags can be configured by Env variables.
Use godoo --help to find out more.

Docker

This workspace also contains Docker and Docker-Compose files. \

They are used to provide either easy Odoo instances where the source is pulled according to odoo_repospec.yml, or as a all batteries included devcontainer for VScode.

Requirements

Just wanna have a quick and easy Odoo Instance?

git clone https://github.com/OpenJKSoftware/gOdoo
cd godoo
cp .env.sample .env # Change this to your liking or pass the env vars directly to the app container.
docker-compose build
docker-compose up
# wait......
# wait a bit mode ...
# just a little bit longer ..
# There we go.
# Odoo should be reachable on 'https://godoo.docker.localhost' assuming you didn't change .env TRAEFIK_HOST_RULE or COMPOSE_PROJECT_NAME

Devcontainer

Features

  • All batteries included Devcontainer with postgres service Container and local DNS resolvig managed by Traefik.
  • Easy fully working Odoo instance by docker-compose up with https access.
  • godoo CLI wrapper around Odoo. (Most flags can be configured by Environment Variables and are already preconfigured in the Containers. See .env.sample)
  • odoo-bin is added to PATH and can thus be invoked from every folder.
  • Odoo will run in Proxy_Mode behind a Traefik reverse proxy for easy access on https://$COMPOSE_PROJECT_NAME.docker.localhost
  • Odoo Pylint plugin preconfigured in vscode
  • Preinstalled vscode Extensions Highlights:

Usage

  1. For Docker on windows: Clone the repo into the WSL2 Filesystem for better IO performance
  2. Have Traefik Running on docker.localhost Example
    There must be a Docker network called traefik that can reach traefik.
  3. Create .env file (see .env.sample)
  4. Open Devcontianer:
    • If you have the Devcontainer CLI: devcontainer open .
    • If not open the workspace in Local Vscode. In the Command pallete search for Devcontainers: Rebuild and Reopen in container
  5. From within the container start Odoo using one of the following commands:
    • make -> Loads Odoo + Workspace Addons
    • make bare -> Loads Odoo with ony web installed.
    • make enterprise -> godoo launch with install script for web_enterprise
    • The full init script is available via "godoo". (See --help for Options)
  6. Open Odoo https://$COMPOSE_PROJECT_NAME.docker.localhost
    For example COMPOSE_PROJECT_NAME=godoo --> https://godoo.docker.localhost
  7. Login with admin:admin
  8. Profit!

Access to Odoo and Thirdparty addon Source

You can access the Odoo source by opening the VsCode workspace full.code-workspace from within the Container. This will open a Multi-Root Workspace. Really waiting for https://github.com/microsoft/vscode-remote-release/issues/3665 here.

Reset Devcontainer Data

When you screwed up so bad its time to just start Over godoo has you covered:

Automatic Reset

There are 3 Options to reset the Dev Env.

  1. From Outside the Container run make reset in the project root to delete docker volumes and restart the container. (Vscode will prompt to reconnect if still open)
  2. From Outside the Container run make reset-hard in the project root to force rebuild the main Odoo container and then do the same as make reset
  3. From Inside the Container run make reset to drop the DB and delete varlib and the bootstrap flag, which is way quicker than the other options.

Manual Reset

  1. Close vscode
  2. Remove app and db container from docker.
  3. Remove volumes: db, odoo_thirdparty, odoo_web, vscode_extensions
  4. Restart Devcontainer

Python Debugging

VsCode Debugging

Debugging doesn't reliably work with Odoo Multiprocess mode enabled.
The container ships with a Vscode Debug profile, that sets --workers 0 to allow for Debugging Breakpoints. See .vscode/launch.json

Interactive Shell

Use godoo shell to enter an interactive shell on the Database.

Odoo Modules

Third Party Modules (repospec.yml)

The godoo bootstrap function, will download some modules using git.
Which Repos to download is specified in odoo_repospec.yml (Default)
Not all of the cloned addons are automatically installed.
Install them via the Apps Page in Odoo using godoo rpc modules install or using odoo-bin.
Modules downloaded on the Odoo Marketplace can be dropped as a .zip archive in ./thirdparty

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

godoo_cli-0.0.3.tar.gz (29.8 kB view hashes)

Uploaded Source

Built Distribution

godoo_cli-0.0.3-py3-none-any.whl (35.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page