Complete Dev Environment Setup
First, Odev 4.0 tutorial guides you through every step to build a local Odoo development setup. Next, it helps you pull source code, create and run databases, and generate custom modules. Moreover, this guide shows you how to back up and restore data reliably. Consequently, you gain a stable workflow for Odoo customization. Therefore, follow along to master Odev 4.0 quickly.
Understanding Odev 4.0 Protocol
First, Odev 4.0 serves as an environment setup tool for Odoo. Next, it automates Python virtual environments, database operations, and asset builds. Moreover, it works across Community and Enterprise editions without extra scripts. Furthermore, it simplifies module scaffolding and demo data loading. Consequently, you avoid manual errors and speed up development.
Pre-requisites for Odev 4.0 tutorial
First, you need a system that supports Odoo 17.0 or 18.0. Next, install Python 3.10+ and Git. Moreover, you require at least 4 GB RAM and 20 GB disk space. Then, prepare a terminal (Linux/macOS) or WSL (Windows). Finally, ensure you have sudo privileges for system-wide dependencies.
System Requirements
- CPU: Modern dual-core processor
- RAM: ≥ 4 GB
- Disk: ≥ 20 GB free space
- OS: Ubuntu 22.04 / Fedora 38 / macOS 12+ / WSL2
- Python: 3.10 or newer
Required Tools
First, install Git by running:
sudo apt update && sudo apt install git
Next, install Python and pip:
sudo apt install python3 python3-venv python3-pip
Moreover, install Node.js and Yarn for asset builds:
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs
npm install --global yarn
Step-by-Step Odev 4.0 tutorial
First, we clone and pull the Odoo source. Next, we create and run the database. Then, we generate and test custom modules. Moreover, we back up and restore data. Consequently, this full cycle empowers you to deliver features faster.
Step 1: Clone & Pull Odoo Source
First, clone your project folder:
git clone https://github.com/OCA/odev.git my-project
cd my-project
Next, pull the default Odoo version:
odev pull
Then, this command fetches the chosen Odoo release (e.g., 18.0) and sets up the project skeleton. Moreover, it creates a .odev folder with configuration files.
Step 2: Create and Run Database
First, create an empty database and install dependencies:
odev create
Next, launch the Odoo server at http://localhost:8069:
odev run
Then, you see log output confirming modules loaded. Moreover, you visit the URL to access the Odoo login page.
Step 3: Activate Virtual Environment
First, Odev 4.0 automatically sets up a Python virtual environment. Next, activate it (if needed):
source .venv/bin/activate
Then, this step ensures pip installs go into an isolated space. Moreover, this avoids conflicts with system Python packages.
Step 4: Backup (Dump) & Restore Database
First, export your database dump to a file:
odev dump > backup.sql
Next, restore data when required:
odev restore backup.sql
Then, this method lets you experiment freely with schema changes. Moreover, it guarantees you can revert to a known state.
Step 5: Generate Custom Module Skeleton
First, scaffold a new addon named my_module:
odev code my_module
Next, this command creates addons/my_module with standard folders:
addons/my_module/
├─ __init__.py
├─ __manifest__.py
├─ models/
│ └─ __init__.py
└─ views/
└─ my_module_views.xml
Then, you edit these files to define models, views, and menu items.
Step 6: Install and Test Your Module
First, add your addon path if it’s outside the default:
odev run --addons-path=addons
Next, log into Odoo → Apps → Update Apps List. Then, search my_module and click Install. Moreover, go to your new menu to verify functionality.
Step 7: Regenerate Assets (JavaScript/CSS)
First, when front-end changes fail to appear, run:
odev demo
Next, this step rebuilds QWeb, LESS, and JS assets. Then, refresh your browser to see updates.
Step 8: Save and Share Your Configuration
First, commit your .odev folder to Git so teammates share the same setup:
git add .odev
git commit -m "Add Odev 4.0 config"
Next, push to your remote repository. Then, your team runs odev pull && odev create && odev run to get identical environments.
Best Practices in Odev 4.0 tutorial
First, adopt clear naming for databases and folders. Next, organize your code for teamwork. Moreover, apply version tagging and automate testing for reliability.
Naming Conventions
- Prefix databases by version:
dev-18.0,test-17.0 - Name modules with company prefix:
xyz_sales_report
Folder Structure
First, keep this layout:
my-project/
├─ .odev/ # Odev config files
├─ addons/ # Custom modules
├─ .venv/ # Python venv
├─ backup.sql # Latest dump
└─ README.md
Next, this clarity speeds up navigation.
Version Management
First, switch Odoo versions easily:
odev pull --version 17.0
Next, this command updates code and dependencies.
Automated Testing
First, integrate your tests in addons/my_module/tests. Next, run them via:
odev run --test-enable
Then, this step ensures new changes don’t break existing features.
Advanced Tips and Tricks
First, you can Dockerize Odev for CI/CD. Next, you can link monitoring tools for performance insights.
Dockerizing Your Odev Setup
First, write a Dockerfile:
FROM python:3.10-slim
WORKDIR /app
COPY .odev /app/.odev
COPY addons /app/addons
RUN pip install odev
CMD ["odev", "run"]
Next, build and run:
docker build -t odev-app .
docker run -p 8069:8069 odev-app
Then, you achieve consistent CI builds.
Integrating with CI/CD
First, add to your GitHub Actions:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with: python-version: 3.10
- name: Install Odev
run: pip install odev
- name: Pull & Test
run: |
odev pull
odev create
odev run --test-enable
Performance Monitoring
First, enable Odoo logging:
[options]
log_level = info
log_file = /var/log/odoo/odoo.log
Next, integrate with tools like Grafana and Prometheus.
Frequently Asked Questions
What is Odev 4.0?
First, Odev 4.0 acts as a wrapper around Odoo CLI. Next, it automates setup, module scaffolding, and asset builds. Then, it works with any Odoo version seamlessly.
How do I switch Odoo versions?
First, run:
odev pull --version 17.0
Next, re-create your database with odev create.
How do I share my Odev config?
First, commit .odev to Git. Next, teammates run git pull.
How do I troubleshoot Odev errors?
First, read logs in logs/ folder. Next, run odev run --log-level=debug.
Conclusion
First, this Odev 4.0 tutorial delivers a full workflow: from initial pull and run to custom module deployment. Next, it shows backup, restore, and best practices. Moreover, it offers advanced CI/CD tips and Docker integration. Therefore, you can now set up, code, test, and maintain Odoo projects faster and more reliably.
For more details, visit the Odev 4.0 GitHub repository.
Discover more from teguhteja.id
Subscribe to get the latest posts sent to your email.

