How oca/l10n-spain works
Overall project context
• Project Type & Purpose: This is an ecosystem of Odoo add-ons providing Spanish-specific functionality for accounting, taxation (AEAT, various tax forms like models 111, 115, 303, 347, etc.), payment integrations (e.g., Redsys, Sabadell confirming), delivery carriers, translation/localization (e.g., Facturae, IGIC), and more.
• It is built on top of the Odoo framework (an MVC-type ERP system in Python), so while the repository contains hundreds of modules, they are all “plugins” that integrate with Odoo’s underlying ORM, business logic, and web client.
File structure
• At a high level, each directory (such as “delivery_dhl_parcel”, “l10n_es_aeat”, “payment_redsys”, etc.) is a self-contained module.
• Each module typically has the standard Odoo directory structure: a manifest file (__manifest__.py), models, views, wizards, data, security, tests, and static files.
• Some modules include API integrations (e.g., using web services), others include reporting (XML reports), while still others handle translation and localization.
• There are shared “setup” and configuration files at the root (pre-commit configs, .editorconfig, etc.), which support the development and integration process but are not part of the runtime architecture.
Main components and relationships
• Odoo Core: At the center, an Odoo server that provides the execution environment for business objects (ORM, business logic, workflows, etc.), along with the PostgreSQL database.
• -on Modules: Each module is plugged into the Odoo framework. Group them by function:
– Localization Modules (l10n_es_aeat, l10n_es_account_asset, l10n_es_partner, l10n_es_facturae, etc.)
– Tax & Regulatory Modules (modules for different AEAT models, VAT Book, Intrastat reporting)
– Payment Modules (payment_redsys, l10n_es_payment_order_confirming_sabadell, etc.)
– Delivery & Logistics Integrations (delivery_dhl_parcel, delivery_gls_asm, delivery_seur_atlas)
– Supporting/Utility Modules (l10n_es_toponyms, l10n_es_cnae)
Architectural patterns and design principles to be highlighted
• Modular Architecture: Emphasize that each add-on acts as a plug-in with common interface points (manifest metadata, model inheritance, view modifications).
• MVC / ORM Patterns: Odoo itself follows an MVC or “Odoo-style” pattern. Models (Python classes), Views (XML layouts), and Controllers/Wizards (Python or XML-driven workflows) are subdivided per module.
• Separation of Concerns: Each module is focused on a specific localization or functionality area, which aids maintainability and reusability.