This project template facilitates Odoo development using Docker, specifically configured for VSCode IDE. It includes setup instructions and tips for effective debugging using the Odoo IDE extension.
Before proceeding, ensure you have the following installed:
- Docker
- Git
- VSCode with the following extensions:
- Docker
- Odoo IDE
- Python Debugger
-
Clone the Project
git clone https://github.com/teguhteja/docker-odoo-dev.git -b 18
-
Get Odoo Stubs Run the script to fetch the
odoo-stub
folder:chmod +x git-clone-odoo-stubs.sh ./git-clone-odoo-stubs.sh
-
Build Docker Image Build the Odoo development image:
docker build -t odoodev:18 .
-
Start Docker Compose Launch Odoo 18 and PostgreSQL 16 containers:
docker compose up -d
-
Add Your Addons Place your addons in the
custom-addons
folder and restart the Docker stack (docker compose restart odoo-dev
) using docker extension vscode. -
Debugging
- Set breakpoints in your source code within VSCode.
- Ensure the debugger is configured to debug external code (
"justMyCode": false
in launch.json). - Access the Odoo source code from the container:
./docker-cp-odoo.sh
- Add breakpoints in the Odoo source code.
- Run the debugger process to start debugging.
-
Copying misc.py in odoodev If backup failures occur with Docker images, modify
misc.py
to resolve issues. -
Debugging Odoo Source Code Modify
"justMyCode": false
inlaunch.json
, download the Odoo folder from the container usingdocker-cp-odoo.sh
, uncomment this line in docker-compose.yml- ./odoo:/usr/lib/python3/dist-packages/odoo
restart stack or docker compose add breakpoints, and start the debugger process .
This README provides detailed steps to set up an Odoo development environment using Docker and VSCode, enabling efficient debugging of Odoo applications. For further details, refer to the full documentation and scripts available in the project repository.
For detailed scripts and further instructions, visit docker-odoo-dev.