# oca/l10n-brazil architecture

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

- Interactive diagram: https://gitdiagram.com/oca/l10n-brazil
- Repository: https://github.com/oca/l10n-brazil

## Overview

##### Project Type and Purpose
- Recognize that this is an Odoo localization project – it customizes and extends the core Odoo ERP system with modules for accounting, invoicing, fiscal documentation, Brazilian tax requirements, banking integrations, human resources, sales, warehouse, manufacturing, and more.
- Readme indicates integration with various Brazilian fiscal norms (NF-e, NFS-e, CT-e, MDF-e, etc.) as well as support for payment initiatives like PIX and PagSeguro.

##### File Tree and Module Structure
- The repository root contains configuration files (e.g., setup, license, requirements) as well as a very extensive set of separate directories; each directory is essentially a different Odoo module (such as l10n_br_account, l10n_br_fiscal, l10n_br_nfe, payment_bacen_pix, etc.).
- Many directories follow the common Odoo module layout: they include subdirectories for models, views, controllers, data, static assets, tests, and sometimes wizards.
- In addition, there is a “setup” directory with subdirectories for each module that show how to package and deploy them in an Odoo environment.

##### Main Components
- Localization Modules: Surrounding the core, create clusters (or grouped nodes) for domain-specific modules:
– Accounting and Financials: l10n_br_account, l10n_br_account_due_list, l10n_br_account_nfe, l10n_br_account_payment_brcobranca, l10n_br_account_payment_order, l10n_br_account_withholding.
– Fiscal and Taxation: l10n_br_fiscal, l10n_br_fiscal_certificate, l10n_br_fiscal_closing, l10n_br_fiscal_dfe, l10n_br_fiscal_edi.
– Base and Localization Fundamentals: l10n_br_base, l10n_br_cnab_structure, l10n_br_coa (and its “generic” and “simple” versions), l10n_br_cnpj_search.
– Modules for other business domains: l10n_br_crm, l10n_br_contract, l10n_br_delivery (and delivery_nfe), l10n_br_hr (and hr_expense_invoice), l10n_br_mdfe (and mdfe_spec), l10n_br_nfse (and its various regional adaptations), l10n_br_portal, l10n_br_pos (including CFE and NFC-e), l10n_br_product_contract, l10n_br_purchase (and purchase_request, purchase_stock), l10n_br_repair, l10n_br_resource, l10n_br_sale (and sale_blanket_order, sale_commission, sale_invoice_plan, sale_stock), l10n_br_setup_tests.
- Payment Integrations: payment_bacen_pix and payment_pagseguro.
- Specification Driven Models: spec_driven_model.

##### Relationships and Interactions
- Modules by domain (for instance, all fiscal modules in one cluster) and indicate dependencies. For example, some modules like l10n_br_nfe may depend on l10n_br_account and l10n_br_fiscal.
- External integrations: Payment modules interface with external banking or payment services. Likewise, some modules (l10n_br_cnpj_search, l10n_br_ie_search) integrate with external web services from government agencies.
- Optionally, show that modules in the “setup” directory are used for packaging and deployment, acting as a bridge between development and runtime installation.

##### Architectural Patterns and Technologies
- Odoo modular design; each module encapsulates its own MVC components (models for business logic, views for presentation, controllers for HTTP endpoints, and wizards for interactive processes).
- Technologies inherently include Python, XML for views/data, and JavaScript for client-side logic, all under the Odoo framework.

## Diagram (Mermaid)

```mermaid
graph TD

    %% Deployment/Setup Cluster
    subgraph "Deployment/Setup"
        DS1["Setup/Packaging (setup/)"]:::deploy
    end

    %% Odoo Core Cluster
    subgraph "Odoo Core"
        CORE["Odoo Core Framework"]:::core
    end

    %% Localization Modules Cluster
    subgraph "Localization Modules"
        %% Accounting & Financials
        subgraph "Accounting & Financials"
            A1["l10n_br_account"]:::accounting
            A2["l10n_br_account_due_list"]:::accounting
            A3["l10n_br_account_nfe"]:::accounting
            A4["l10n_br_account_payment_brcobranca"]:::accounting
            A5["l10n_br_account_payment_order"]:::accounting
            A6["l10n_br_account_withholding"]:::accounting
        end

        %% Fiscal & Taxation
        subgraph "Fiscal & Taxation"
            F1["l10n_br_fiscal"]:::fiscal
            F2["l10n_br_fiscal_certificate"]:::fiscal
            F3["l10n_br_fiscal_closing"]:::fiscal
            F4["l10n_br_fiscal_dfe"]:::fiscal
            F5["l10n_br_fiscal_edi"]:::fiscal
        end

        %% Base & Fundamentals
        subgraph "Base & Fundamentals"
            B1["l10n_br_base"]:::base
            B2["l10n_br_cnab_structure"]:::base
            B3["l10n_br_cnpj_search"]:::base
            B4["l10n_br_coa"]:::base
            B5["l10n_br_coa_generic"]:::base
            B6["l10n_br_coa_simple"]:::base
        end

        %% Other Business Domains
        subgraph "Other Business Domains"
            O1["l10n_br_contract"]:::other
            O2["l10n_br_crm"]:::other
            O3["l10n_br_cte"]:::other
            O4["l10n_br_cte_spec"]:::other
            O5["l10n_br_hr"]:::other
            O6["l10n_br_hr_expense_invoice"]:::other
            O7["l10n_br_mdfe"]:::other
            O8["l10n_br_mdfe_spec"]:::other
            O9["l10n_br_mis_report"]:::other
            O10["l10n_br_nfse"]:::other
            O11["l10n_br_nfse_barueri"]:::other
            O12["l10n_br_nfse_focus"]:::other
            O13["l10n_br_nfse_ginfes"]:::other
            O14["l10n_br_nfse_paulistana"]:::other
            O15["l10n_br_portal"]:::other
            O16["l10n_br_pos"]:::other
            O17["l10n_br_pos_cfe"]:::other
            O18["l10n_br_pos_nfce"]:::other
            O19["l10n_br_product_contract"]:::other
            O20["l10n_br_purchase"]:::other
            O21["l10n_br_purchase_request"]:::other
            O22["l10n_br_purchase_stock"]:::other
            O23["l10n_br_repair"]:::other
            O24["l10n_br_resource"]:::other
            O25["l10n_br_sale"]:::other
            O26["l10n_br_sale_blanket_order"]:::other
            O27["l10n_br_sale_commission"]:::other
            O28["l10n_br_sale_invoice_plan"]:::other
            O29["l10n_br_sale_stock"]:::other
            O30["l10n_br_setup_tests"]:::other
            O31["l10n_br_stock"]:::other
            O32["l10n_br_stock_account"]:::other
            O33["l10n_br_stock_account_report"]:::other
            O34["l10n_br_website_sale"]:::other
            O35["l10n_br_website_sale_delivery"]:::other
            O36["l10n_br_zip"]:::other
        end
    end

    %% Payment Integrations Cluster
    subgraph "Payment Integrations"
        P1["payment_bacen_pix"]:::payment
        P2["payment_pagseguro"]:::payment
    end

    %% Specification Driven Models Cluster
    subgraph "Specification Driven Models"
        S1["spec_driven_model"]:::spec
    end

    %% Connections
    DS1 --> CORE

    %% Accounting Modules to Core
    A1 --> CORE
    A2 --> CORE
    A3 --> CORE
    A4 --> CORE
    A5 --> CORE
    A6 --> CORE

    %% Fiscal Modules to Core
    F1 --> CORE
    F2 --> CORE
    F3 --> CORE
    F4 --> CORE
    F5 --> CORE

    %% Base Modules to Core
    B1 --> CORE
    B2 --> CORE
    B3 --> CORE
    B4 --> CORE
    B5 --> CORE
    B6 --> CORE

    %% Other Business Domain Modules to Core
    O1 --> CORE
    O2 --> CORE
    O3 --> CORE
    O4 --> CORE
    O5 --> CORE
    O6 --> CORE
    O7 --> CORE
    O8 --> CORE
    O9 --> CORE
    O10 --> CORE
    O11 --> CORE
    O12 --> CORE
    O13 --> CORE
    O14 --> CORE
    O15 --> CORE
    O16 --> CORE
    O17 --> CORE
    O18 --> CORE
    O19 --> CORE
    O20 --> CORE
    O21 --> CORE
    O22 --> CORE
    O23 --> CORE
    O24 --> CORE
    O25 --> CORE
    O26 --> CORE
    O27 --> CORE
    O28 --> CORE
    O29 --> CORE
    O30 --> CORE
    O31 --> CORE
    O32 --> CORE
    O33 --> CORE
    O34 --> CORE
    O35 --> CORE
    O36 --> CORE

    %% Payment Integrations to Core
    P1 --> CORE
    P2 --> CORE

    %% Specification Driven Models to Core
    S1 --> CORE

    %% Inter-module dependency (example)
    A3 -->|"depends_on"| F1

    %% Click Events
    click CORE "https://github.com/oca/l10n-brazil/tree/14.0/setup/l10n_br_base"
    click A1 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account"
    click A2 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account_due_list"
    click A3 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account_nfe"
    click A4 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account_payment_brcobranca"
    click A5 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account_payment_order"
    click A6 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_account_withholding"
    click F1 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_fiscal"
    click F2 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_fiscal_certificate"
    click F3 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_fiscal_closing"
    click F4 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_fiscal_dfe"
    click F5 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_fiscal_edi"
    click B1 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_base"
    click B2 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_cnab_structure"
    click B3 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_cnpj_search"
    click B4 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_coa"
    click B5 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_coa_generic"
    click B6 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_coa_simple"
    click O1 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_contract"
    click O2 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_crm"
    click O3 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_cte"
    click O4 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_cte_spec"
    click O5 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_hr"
    click O6 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_hr_expense_invoice"
    click O7 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_mdfe"
    click O8 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_mdfe_spec"
    click O9 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_mis_report"
    click O10 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_nfse"
    click O11 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_nfse_barueri"
    click O12 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_nfse_focus"
    click O13 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_nfse_ginfes"
    click O14 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_nfse_paulistana"
    click O15 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_portal"
    click O16 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_pos"
    click O17 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_pos_cfe"
    click O18 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_pos_nfce"
    click O19 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_product_contract"
    click O20 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_purchase"
    click O21 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_purchase_request"
    click O22 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_purchase_stock"
    click O23 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_repair"
    click O24 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_resource"
    click O25 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_sale"
    click O26 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_sale_blanket_order"
    click O27 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_sale_commission"
    click O28 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_sale_invoice_plan"
    click O29 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_sale_stock"
    click O30 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_setup_tests"
    click O31 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_stock"
    click O32 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_stock_account"
    click O33 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_stock_account_report"
    click O34 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_website_sale"
    click O35 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_website_sale_delivery"
    click O36 "https://github.com/oca/l10n-brazil/tree/14.0/l10n_br_zip"
    click P1 "https://github.com/oca/l10n-brazil/tree/14.0/payment_bacen_pix"
    click P2 "https://github.com/oca/l10n-brazil/tree/14.0/payment_pagseguro"
    click S1 "https://github.com/oca/l10n-brazil/tree/14.0/spec_driven_model"

    %% Styles
    classDef core fill:#fdd,stroke:#333,stroke-width:2px;
    classDef deploy fill:#eee,stroke:#333,stroke-width:2px;
    classDef accounting fill:#cfc,stroke:#333,stroke-width:2px;
    classDef fiscal fill:#ccf,stroke:#333,stroke-width:2px;
    classDef base fill:#fc9,stroke:#333,stroke-width:2px;
    classDef other fill:#cff,stroke:#333,stroke-width:2px;
    classDef payment fill:#ffc,stroke:#333,stroke-width:2px;
    classDef spec fill:#d9f,stroke:#333,stroke-width:2px;
```
