# simgonzalez/edi architecture

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

- Interactive diagram: https://gitdiagram.com/simgonzalez/edi
- Repository: https://github.com/simgonzalez/edi

## Overview

This project is a large-scale, modular collection of Odoo add‐ons developed by the Odoo Community Association (OCA) to implement and enhance Electronic Data Interchange (EDI) functionality. Rather than being a monolithic application, it’s organized as many separate modules (or “addons”), each responsible for a specific business function such as invoice generation, import/export of documents (PDF, XML, UBL, Factur-X/ZUGFeRD), partner identification, and other EDI-related functions. In essence, the core “system” here is the Odoo ERP platform into which these EDI modules plug as separate components that can be maintained and deployed individually while still integrating with the central Odoo system.

##### Main Components
a. Odoo Core Platform: Represent the Odoo server as the central runtime environment that loads and executes all add-ons.
b. EDI Modules: Group the various add-ons by their business functionality—for example:
- Invoice Modules – (account_einvoice_generate, account_invoice_export, account_invoice_facturx, account_invoice_import, account_invoice_ubl and its email attachment variant)
- Purchase & Sale Order Modules – (sale_order_import, sale_order_import_ubl, sale_order_ubl, purchase_order_ubl, sale_order_customer_free_ref, etc.)
- Base and Integration Support Modules – (base_edi, base_ubl, base_facturx, partner_identification_import, pdf_helper, etc.)
- EDI Process and Endpoint Modules – (edi_account_invoice_import, edi_account_oca, edi_endpoint_oca, edi_exchange_template_oca, edi_oca, etc.)
c. Common/Shared Services: These include modules that act as common frameworks (such as base modules) which provide shared functionality used by many "child" modules.
d. External Interfaces & Integration Points: This includes connections to external systems (e.g., OVH API integrations, external storage backends, webservice endpoints, etc.) that interact with specific modules like account_invoice_download_ovh or edi_webservice_oca.
e. Testing, CI/CD and Configuration: Note the presence of continuous integration configurations (GitHub workflows, pre-commit tests, etc.) and configuration files that are part of the development infrastructure.

##### Relationships and Interactions
d. Integration flows from external services (like OVH API, external document providers, or webservices) into their corresponding modules (for example, connecting an external invoice download service into account_invoice_download_ovh).
e. Where modules “plug in” to each other (like how edi_sale_order_import_ubl builds on sale_order_import), show connecting lines to illustrate these relationships.

##### Architectural Patterns and Design Principles
a. Modular / Layered Architecture: Emphasize that the system architecture is composed of independent but interlinked modules. Each module “owns” a particular set of functionalities that extend Odoo’s base system.
b. Reusability and Separation of Concerns: Many modules reuse functionality provided by common base modules.
c. Integration via Standardized Interfaces: Highlight that all modules must conform to the Odoo framework’s API for views, models, and data exchange, ensuring smooth integration across different business areas.

##### Relevant Technologies and Frameworks
a. Use Odoo’s ORM and MVC framework as the technical basis for most modules.
b. Each add-on often contains XML files for view configurations, Python files for business logic, and i18n files for translations. Optionally, annotate these details where relevant.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Interfaces & Integration
    subgraph "External Interfaces & Integration"
        ext1["OVH API Integration"]:::external
        ext2["EDI Webservice OCA"]:::external
    end

    %% EDI Process & Endpoint Modules
    subgraph "EDI Process & Endpoint Modules"
        edi1["edi_account_invoice_import"]:::edi
        edi2["edi_account_oca"]:::edi
        edi3["edi_endpoint_oca"]:::edi
        edi4["edi_exchange_template_oca"]:::edi
        edi5["edi_oca"]:::edi
    end

    %% Invoice Modules
    subgraph "Invoice Modules"
        invoice1["account_einvoice_generate"]:::invoice
        invoice2["account_invoice_export"]:::invoice
        invoice3["account_invoice_facturx"]:::invoice
        invoice4["account_invoice_import"]:::invoice
        invoice5["account_invoice_ubl"]:::invoice
        invoice6["account_invoice_ubl_email_attachment"]:::invoice
        invoice7["account_invoice_download"]:::invoice
        invoice8["account_invoice_download_ovh"]:::invoice
    end

    %% Purchase & Sale Order Modules
    subgraph "Purchase & Sale Order Modules"
        order1["sale_order_import"]:::order
        order2["sale_order_import_ubl"]:::order
        order3["sale_order_customer_free_ref"]:::order
        order4["purchase_order_ubl"]:::order
        order5["purchase_stock_ubl"]:::order
    end

    %% Base & Integration Support Modules
    subgraph "Base & Integration Support Modules"
        base1["base_edi"]:::base
        base2["base_facturx"]:::base
        base3["base_ubl"]:::base
        base4["partner_identification_import"]:::base
        base5["pdf_helper"]:::base
    end

    %% Odoo Core Platform
    subgraph "Odoo Core Platform"
        core["Odoo Core Platform"]:::core
    end

    %% Development Infrastructure
    subgraph "Development Infrastructure"
        infra["CI/CD & Testing"]:::infra
    end

    %% Connections from Odoo Core Platform to Module Groups
    core -->|"loads"| base1
    core -->|"loads"| invoice1
    core -->|"loads"| order1
    core -->|"loads"| edi1

    %% Base Modules provide common functionality to specialized modules
    base1 -->|"provides"| invoice1
    base1 -->|"provides"| order1
    base1 -->|"provides"| edi1

    base2 -->|"provides"| invoice1
    base3 -->|"provides"| invoice1
    base4 -->|"provides"| invoice1
    base5 -->|"provides"| invoice1

    %% External integrations flow into modules
    ext1 ---|"integrates"| invoice8
    ext2 ---|"integrates"| edi1

    %% Inter-module relationships within groups
    order1 -->|"extends"| order2
    invoice5 -->|"supports"| invoice6
    invoice4 -->|"triggers"| edi1

    %% Development Infrastructure supports Odoo Core
    infra ---|"configures"| core

    %% Class Definitions for styling
    classDef core fill:#ffdb58,stroke:#333,stroke-width:2px;
    classDef invoice fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef order fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef base fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef edi fill:#d1c4e9,stroke:#333,stroke-width:2px;
    classDef external fill:#ffe6cc,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef infra fill:#e2e0cb,stroke:#333,stroke-width:2px,stroke-dasharray: 3 3;

    %% Click Events
    click core "https://github.com/simgonzalez/edi/tree/14.0/setup/account_einvoice_generate/odoo/addons"
    click infra "https://github.com/simgonzalez/edi/blob/14.0/.github"
    
    click invoice1 "https://github.com/simgonzalez/edi/tree/14.0/account_einvoice_generate"
    click invoice2 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_export"
    click invoice3 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_facturx"
    click invoice4 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_import"
    click invoice5 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_ubl"
    click invoice6 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_ubl_email_attachment"
    click invoice7 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_download"
    click invoice8 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_download_ovh"
    
    click order1 "https://github.com/simgonzalez/edi/tree/14.0/sale_order_import"
    click order2 "https://github.com/simgonzalez/edi/tree/14.0/sale_order_import_ubl"
    click order3 "https://github.com/simgonzalez/edi/tree/14.0/sale_order_customer_free_ref"
    click order4 "https://github.com/simgonzalez/edi/tree/14.0/purchase_order_ubl"
    click order5 "https://github.com/simgonzalez/edi/tree/14.0/purchase_stock_ubl"
    
    click base1 "https://github.com/simgonzalez/edi/tree/14.0/base_edi"
    click base2 "https://github.com/simgonzalez/edi/tree/14.0/base_facturx"
    click base3 "https://github.com/simgonzalez/edi/tree/14.0/base_ubl"
    click base4 "https://github.com/simgonzalez/edi/tree/14.0/partner_identification_import"
    click base5 "https://github.com/simgonzalez/edi/tree/14.0/pdf_helper"
    
    click edi1 "https://github.com/simgonzalez/edi/tree/14.0/edi_account_invoice_import"
    click edi2 "https://github.com/simgonzalez/edi/tree/14.0/edi_account_oca"
    click edi3 "https://github.com/simgonzalez/edi/tree/14.0/edi_endpoint_oca"
    click edi4 "https://github.com/simgonzalez/edi/tree/14.0/edi_exchange_template_oca"
    click edi5 "https://github.com/simgonzalez/edi/tree/14.0/edi_oca"
    
    click ext1 "https://github.com/simgonzalez/edi/tree/14.0/account_invoice_download_ovh"
    click ext2 "https://github.com/simgonzalez/edi/tree/14.0/edi_webservice_oca"
```
