2020-12-15 14:47:22 +01:00
2020-12-15 14:47:22 +01:00
2020-12-14 17:52:51 +01:00
2020-11-03 12:30:31 +01:00
2020-11-30 16:12:16 +01:00
2020-11-30 16:12:16 +01:00
2020-11-30 16:12:16 +01:00
2020-10-13 13:01:45 +02:00
2020-12-15 14:47:22 +01:00
2020-11-30 16:12:16 +01:00
2020-08-17 09:21:11 +02:00
2020-11-30 16:13:05 +01:00
2020-11-17 11:50:32 +01:00
2020-12-14 17:52:51 +01:00
2020-12-14 17:52:51 +01:00

Odoo Development

The Mint System Odoo development environment.

This projects provides a highly opiniated way to develope Odoo and Odoo modules. It supports the following scenarios:

  • Docker Compose: Spin up a Odoo, Postgres and pgAdmin Docker container and experiment locally.
  • Import and Export Database: Use Odoo scripts to copy and restore a remote customer database in the local development environment. Investigate issues and deploy the database at whish.
  • Community Edition: Checkout the Odoo Community Edition and start editing the source code.
  • Enterprise Modules: Checkout the Odoo enterprise modules and deploy them into the Odoo Docker container or the Odoo source.
  • Develope Modules: Scaffold a new module and develope new Odoo features locally.

Table of Contents

Requirements

The Odoo development environment has the following requirements:

Usage

The usage section is set of recipes. Pick the one required according to your scenario.

Clone this repository.

git clone https://github.com/Mint-System/Odoo-Development.git odoo-development
cd odoo-development

Checkout branch.

task checkout 13.0
task checkout 14.0

Disable auto install for Odoo apps.

task disable-auto-install

Docker

Run Odoo with Docker container.

Start and initialize Odoo with Docker

Run docker compose.

task start

Initialize database.

docker-odoo-install

Open browser to http://localhost:8069 and login with admin:admin.

Install custom module

docker-odoo-install -m show_db_name

Save config with Docker

docker exec -it odoo bin/bash -c "odoo -s -d odoo --db_host \$HOST -r \$USER -w \$PASSWORD"

Source

Run Odoo from source.

Create and activate virtual env

Create and activate the virtual env.

task venv-init

Install Odoo source requirements

Pull the odoo submodule and install the python dependencies.

git submodule update odoo
task install-src

Py3o Report Engine

If you are using the Py3o report engine additional packages are required:

cd odoo
pip install py3o.template py3o.formats
cd ..
# MacOS
brew cask install libreoffice
# Ubuntu
apt-get --no-install-recommends install libreoffice

Initialize and start Odoo from source

Run database container only

task start-db

Initialize database

task init-db

Start Odoo from source

task start-src

Open browser to http://localhost:8069 and login with admin:admin.

Create a new module from source

Scaffold a new module.

task scaffold-src project_report

Common

Instructions that are true for Docker and Source usage paths.

Enable developer mode

Open this url http://localhost:8069/web?debug=1, which contains the debug flag.

Manage database with Docker

Open database manager http://localhost:8000/ and login with admin@example.com:admin.

Remove Docker conainers

Kill docker containers and volumes.

docker-compose down -v

Stop all Docker containers

task stop

Remove database

task drop-db odoo

Install Odoo REST API dependencies

pip install -r addons/rest_api/requirements.txt

Or with Docker:

docker exec odoo pip3 install -r /mnt/extra-addons/rest_api/requirements.txt
docker restart odoo

Managed Modules

Manage Odoo modules.

Setup managed modules

Update the entries in the list managed_modules.txt.

Checkout a specific git revision in the Odoo enterprise repository.

Run task compile-managed-modules to create zip files for the managed modules.

Load and unload managed modules

Run task copy-managed-modules to load the managed modules into the addons folder.

Execute the script task remove-managed-mdoules to delete the managed modules from the addons folder.

Export pgAdmin connections

docker exec pgadmin python setup.py --dump-servers /var/tmp/servers.json --user admin@example.com; cat /var/tmp/servers.json

Mail

View emails

Open the mail client http://localhost.

Send email

Use curl to send an email to support@localhost:

task send-support-mail
S
Description
No description provided
Readme AGPL-3.0
13 MiB
0 Stars 3 Watchers 0 Forks
Languages
Shell 48.7%
Python 40.4%
JavaScript 7.6%
Dockerfile 2.8%
HTML 0.3%
Other 0.2%