# odoo-dev/odoo architecture

> Architecture diagram of the GitHub repository odoo-dev/odoo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/odoo-dev/odoo
- Repository: https://github.com/odoo-dev/odoo

## Overview

##### (nonexistent) file structure
- In a real Odoo repository you’d typically see:
- `addons/` – Python modules that implement business logic
- `odoo/` or `src/odoo/` – core framework code
- `doc/`, `tests/`, and `tools/` directories
- Configuration files like `odoo.conf`, `requirements.txt`, `Dockerfile`, and CI scripts
- These top-level directories indicate a modular, plug-in architecture where each module (“addon”) registers models, views, controllers, and data files.

##### README for additional insights
- The real Odoo README describes:
- Supported Python versions
- Deployment options (dev server, docker, package)
- Architecture overview (ORM, controllers, QWeb templates, JS client, etc.)
- Extension points (module manifest files, RPC endpoints)

a. Main components
1. Web Client (Browser UI)
2. HTTP Server / WSGI Gateway
3. Odoo Application Layer
– Controllers / HTTP routing
– ORM & Model Layer
– Business-logic modules (addons)
– Template engine (QWeb)
4. PostgreSQL Database
5. External Services (SMTP, Payment Gateways, LDAP auth, etc.)
6. Optional: Message queue (e.g., Celery/RabbitMQ) for async jobs
7. File store (attachments, filestore)
b. Relationships and interactions
- Browser ↔ HTTP Server over HTTPS
- HTTP Server ↔ Odoo Application through WSGI
- Odoo Application ↔ PostgreSQL via ORM
- Odoo Application ↔ External Services over REST/SMTP/LDAP protocols
- Background workers ↔ Odoo Application through message broker
c. Architectural patterns and principles
– Modular MVC/MVT pattern: separate models, views, controllers
– Plugin architecture: each addon self-registers its models, views, menu entries
– Layered architecture: Presentation (JS + QWeb), Application (Python), Data (DB)
– Event-driven or message-driven background processing
d. Technologies and frameworks
– Python 3.x, psycopg2 (PostgreSQL driver)
– Odoo framework core modules
– JavaScript, XML, QWeb for client-side UI
– HTTP server (Werkzeug, Gunicorn, or Odoo’s built-in)
– PostgreSQL database
– Optional: RabbitMQ/Celery for async tasks, Redis for caching

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["Web Browser"]:::frontend
    end

    %% Load Balancer / HTTP Server
    HTTP["Load Balancer / HTTP Server\n(Werkzeug/Gunicorn)"]:::backend

    %% Odoo Application Layer
    subgraph "Odoo Application Layer"
        Controllers["Controllers / HTTP Routing"]:::backend
        ORM["ORM & Model Layer"]:::backend
        QWeb["QWeb Template Engine"]:::backend
        Modules["Business Modules\n(addons)"]:::backend
        Workers["Background Workers\n(Celery/RabbitMQ)"]:::backend
    end

    %% Data Stores
    DB[(PostgreSQL Database)]:::datastore
    FileStore[(File Store / Attachments)]:::datastore

    %% External Services
    Ext["External Services\n(SMTP, Payment Gateways,\nLDAP, REST APIs)"]:::external

    %% Connections
    Browser -->|"HTTPS"| HTTP
    HTTP -->|"WSGI"| Controllers
    Controllers --> ORM
    Controllers --> QWeb
    Controllers --> Modules
    Modules --> ORM
    ORM --> DB
    ORM --> FileStore
    Controllers --> Ext
    Controllers --> Workers
    Workers --> ORM
    Workers --> Ext

    %% Styles
    classDef frontend fill:#aecbfa,stroke:#2f4f4f,color:#000;
    classDef backend fill:#c6e2ff,stroke:#2f4f4f,color:#000;
    classDef datastore fill:#ffe4b5,stroke:#2f4f4f,color:#000;
    classDef external fill:#d3d3d3,stroke:#2f4f4f,color:#000;
```
