sorce project https://github.com/teguhteja/docker-odoo-dev.git
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 this Project
-
Get Odoo Stubs Clone
odoo-stub
project:git clone -b 18.0 https://github.com/odoo-ide/odoo-stubs.git
Utilizzando questi stub, gli IDE forniranno un migliore completamento del codice, Le selezionatrici di tipo statico forniranno rapporti migliori.
-
Build Docker Image Build the Odoo development image:
docker build -t odoodev:18 .
-
Start Docker Compose Launch Odoo 18 and PostgreSQL containers:
docker compose up -d
-
Add Your Addons Place your addons in the
extra-addons
folder and restart the Docker stack (docker compose restart odoo-dev
) using docker extension vscode. -
Copy the Odoo source code from the container:
./docker-cp-odoo.sh
-
Debugging
- Set breakpoints in your source code within VSCode.
- Ensure the debugger is configured to debug external code (
"justMyCode": false
in launch.json). - Add breakpoints in the Odoo source code. (se vuoi)
- 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.