This is the Mint System Odoo development environment.
This projects provides a highly opinionated way to manage and develop Odoo. It features:
- 🔍 Odoo Source: Checkout the Odoo Community and Enterprise Edition and start editing the source code.
- 🐳 Container Compose: Spin up an Odoo, Postgres, and pgAdmin container and experiment locally.
- 💻 Native: Start an Odoo server directly from the source.
- 🔄 Multiple Versions: With Odoo Build, you can switch between Odoo versions starting from 13.0 up to 18.0.
- 🛠️ Develop Modules: Scaffold new modules, develop new Odoo features locally.
- 📥 Import and Export Database: Use Odoo scripts to copy and restore a customer database to the local environment. Investigate issues and deploy the database with ease.
- 🤝 Community Repos: The most common community repos are checked out when setting up the project.
- ✂️ Customizing Snippets: Create snippets and push them to an Odoo database.
- 🕰️ Odoo Revisions: Snapshot the Odoo source at a specific date. See revisions for details.
- 📦 Container Image: Build and publish a custom Odoo images. See README for details.
- 🔑 Credentials: Manage login credentials for Odoo and Nextcloud.
- ⬆️ Odoo Upgrade: Helper commands to ease the Odoo upgrade process.
- 🧠 LLM: Prompt LLMs with module code and apply changes.
- 🚀 And More: See task help.
The Odoo development environment has the following requirements:
Command Completion (Optional)
bash/zsh alias task='./task' with completion.
Nix (Optional)
You can use Nix to setup the requirements.
LLM (Optional)
Install the llm cli to make use of the LLM features.
The usage section is a set of workflows. See task help or task for details about the project commands.
Clone this repository.
git clone git@github.com:Mint-System/Odoo-Build.git
cd Odoo-BuildWhen working with Nix, run the nix-shell.
nix-shellCheckout the Odoo version. Show supported versions with task list-versions.
task checkout "$VERSION"Install build and Python dependencies.
task installDecide wether you want to run Odoo in native mode (recommended) or as a container.
Run Odoo from source. Currently supported OS: Ubuntu, Debian, Pop!_OS, Darwin, Windows with Ubuntu on WSL2.
Start database container only.
task start dbInitialize database.
task init-dbStart Odoo from source.
task start nativeThe browser will be opened automatically.
Create a new module.
task create-module addons/project/project_sprintAdd a new model.
task generate-module-model addons/project/project_sprint project.sprintAdd model security.
task generate-module-security addons/project/project_sprint project.sprintClone thirdparty repos into the thirdparty folder.
To load modules from a thirdparty folder, set this env var in your .env file:
ODOO_ADDONS_PATH=thirdparty/odoo-apps-partner-contact,../odoo-cd/untracked-odoo-appsThe paths will be appended to the Odoo config.
In your .env file define this Odoo parameter env var:
ODOO_PARAM=--without-demo=allThe default database name is the checked out Odoo version.
To define another name, set this env var in your .env file:
ODOO_DATABASE=odooTo disable the browser open when starting the Odoo server edit the .env file:
BROWSER_OPEN=falseRun Odoo as container.
Set the Odoo addons path in your .env file:
ODOO_ADDONS_PATH=/mnt/addons/,/mnt/oca/,/mnt/enterprise,/mnt/themes/Run container compose.
task startInitialize database with the image script.
task run odoo init-dbOpen browser to http://localhost:8069 and login with admin:admin.
If you are using podman, set this .env var:
CONTAINER_ENGINE=podmanThese instructions are true for container and native usage.
To change the log level of Odoo set this env var in your .env file:
LOG_LEVEL=debugStart pgadmin.
task pgadminOpen pgadmin http://localhost:8000/ and login with admin@example.com:admin.
Removes containers and volumes.
task removeWithout service name the stop commands stops all containers.
task stopTo drop the default database run:
task drop-dbDefine the Postgres image in your .env file:
POSTGRES_IMAGE=postgres:16-alpineEnsure your container setup can build multi-platform images.
Checkout latest revision of the Odoo version.
task checkout-latest-revision "16.0"Build the Odoo image.
task buildTest the image.
task test-projectPublish the Odoo image.
task publishStart mailpit server.
task start mailpitWhen you send mails in Odoo they will be catched and shown on http://localhost:8025/.
Assuming the name of the environment is test, you source env vars like this:
eval "$(task show-env test)"Update the upgrade script:
wget https://upgrade.odoo.com/upgrade -O image/odoo-upgrade/bin/upgradeStart all containers.
task startInitialize the Odoo database.
task run odoo init-dbLog into Odoo and setup an alias for info@yourcompany.com.
Send a test mail with swaks:
swaks --to info@yourcompany.com --from sender@example.com \
--server localhost:25 \
--body "This is a test email for the Odoo mailgate system." \
--header "Subject: Test Email for Odoo"The mail will be forwarded to Odoo.
Trace the mailgate log with:
docker exec mailgate tail -f /var/log/mail.logYou can also send a mail with tls encryption:
swaks --to info@yourcompany.com --from sender@example.com \
--server localhost:587 \
--tls \
--body "This is a test email for the Odoo mailgate system." \
--header "Subject: Test Email for Odoo"Check the latest official Odoo image tag on https://hub.docker.com/_/odoo/tags.
Replace the - with a . in the tag name and create a revision:
task create-revision 18.0.20250520Replace all image references in the docs.
Install copier.
source task source
uv pip install copierRun copier and select ruff as linter.
copier copy --UNSAFE https://github.com/OCA/oca-addons-repo-template.git "templates/$VERSION"Remove unnecessary linter files.
cd "templates/$VERSION"
rm -rf .github
rm .copier-answers.yml
rm .flake8
rm .isort.cfg
rm .pylintrc-mandatory
rm README.mdIn .pre-commit-config.yaml remove mandatory pylint odoo:
- id: pylint_odoo
args:
- --rcfile=.pylintrc-mandatoryIn .pylintrc remove these rules:
- missing-return
- duplicate-xml-record-id
- redefined-builtin
In the .ruff.toml set this option:
line-length = 120Template the server tools repo and run the linter:
task template-repo addons/server_tools
cd addons/server_tools
task allRefine the templates based on the linter results.
In VSCode define a break point for a selected method.
Run Odoo native with a debugger.
task debug nativeIn VSCode run Python - attach debugger to attach the debugger.
Open http://localhost:8069 and run the method that you want to debug.
VSCode should jump to the breakpoint and you can step through the method.
Run Odoo with memray.
task record-with-memray nativeOpen http://localhost:8069 and finish the recording with ctrl+c.
The flamegraph report will be generated an opened.
Run Odoo and get the process id.
PID=$(ps -eo pid,comm | grep -m 1 'odoo' | awk '{print $1}')Record the Odoo process with py-spy.
task record-with-py-spy "$PID"Finish the recording with ctrl+c.
The browser will open https://www.speedscope.app/. Upload the tmp/speedscope-profiling.json file.