Skip to content
Setup Odoo development environment with Docker Compose.
HTML Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
addons
config
.gitignore
.gitmodules
README.md
TODO.md
docker-compose.yml

README.md

Odoo Development

Setup Odoo development environment with Docker Compose.

Usage

Clone this repository.

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

Run docker compose.

docker-compose up -d

Initialize database and install modules.

export MODULES=base,project,hr_timesheet,timesheets_by_employee
docker exec -it odoo-development_web_1 bin/bash -c "odoo -i $MODULES -c /etc/odoo/odoo.conf -d odoo --db_host \$HOST -r \$USER -w \$PASSWORD --dev=all --stop-after-init" && docker restart odoo-development_web_1

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

Configure mail

Create a .env file in the project root.

SMTP_PASSWORD=...
SMTP_PORT=...
SMTP_SERVER=...
SMTP_USER=...

Install Odoo with the smtp params.

export MODULES=base,project,hr_timesheet,timesheets_by_employee
docker exec -it odoo-development_web_1 bin/bash -c "odoo -i $MODULES -c /etc/odoo/odoo.conf -d odoo --db_host \$HOST -r \$USER -w \$PASSWORD --dev=all --stop-after-init --smtp=\$SMTP_SERVER --smtp-port=\$SMTP_PORT --smtp-ssl --smtp-user=\$SMTP_USER --smtp-password=\$SMTP_PASSWORD" && docker restart odoo-development_web_1

Enable developer mode

Navigate to the settings page and click on Activate the developer mode (with assets).

Create new module

Scaffold a new module.

docker exec -it odoo-development_web_1 bin/bash -c 'odoo scaffold qm_data_system /mnt/extra-addons'

Restart Odoo.

docker restart odoo-development_web_1

Manage database

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

Add a new database connection with these credentials:

Name: odoo
Host: db
Username: odoo
Password: odoo

Uninstall

Kill docker containers.

docker-compose down -v

Install custom module

export MODULE=employee_documents_expiry
docker exec -it odoo-development_web_1 bin/bash -c "odoo -i $MODULE -c /etc/odoo/odoo.conf -d odoo --db_host \$HOST -r \$USER -w \$PASSWORD --stop-after-init" && docker restart odoo-development_web_1

Create new db

docker exec -it odoo-development_web_1 bin/bash
createdb -h $HOST -U $USER Test
# Enter password
psql -h $HOST -U $USER -l
# Enter password
odoo -i base -c /etc/odoo/odoo.conf -d Test --db_host $HOST -r $USER -w $PASSWORD --stop-after-init

http://localhost:8069/?db=Test

Delete db

docker exec -it odoo-development_web_1 bin/bash
psql -h $HOST -U $USER -l
# Enter password
dropdb -h $HOST -U $USER Test
# Enter password

Save config

docker exec -it odoo-development_web_1 bin/bash -c "odoo -s -d Test --db_host \$HOST -r \$USER -w \$PASSWORD"
# odoo -s -d Test --db_host $HOST -r $USER -w $PASSWORD
You can’t perform that action at this time.