# oca/mis-builder architecture

> Architecture diagram of the GitHub repository oca/mis-builder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oca/mis-builder
- Repository: https://github.com/oca/mis-builder

## Overview

MIS Builder is an Odoo reporting product for configurable KPI-by-period reports, especially accounting statements. Users define reusable report templates and periods, evaluate accounting or other model data into KPI values, then inspect results interactively or export them. The repository also includes budgeting and a demo committed-purchase source. The principal calculation and XLSX paths are visible in excerpts; several other capabilities are documented in the README but their implementation details were not sampled, so those links are documented rather than inferred from filenames.

Main entry points: [`mis_builder/models/mis_report_instance.py`](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance.py) (Report instances), [`mis_builder/models/mis_report.py`](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report.py) (Report templates), [`mis_builder/models/kpimatrix.py`](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/kpimatrix.py) (KPI matrix), [`mis_builder/models/aep.py`](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/aep.py) (Accounting engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Report design"]
  node_templates["Report templates<br/>[mis_report.py]"]
  node_instances["Report instances"]
  node_dashboard["Dashboard wizard"]
  node_periods["Report periods"]
end

subgraph group_engine["Calculation engine"]
  node_accounting_engine["Accounting engine<br/>[aep.py]"]
  node_data_sources["Other data sources<br/>[mis_report.py]"]
  node_expressions["Expression evaluator"]
  node_safe_eval["Safe evaluation<br/>[mis_safe_eval.py]"]
  node_kpi_matrix["KPI matrix<br/>[kpimatrix.py]"]
  node_array_values["Array arithmetic<br/>[simple_array.py]"]
end

subgraph group_delivery["Results and exports"]
  node_styles["Report styles"]
  node_widget["Interactive report"]
  node_annotations["Cell annotations"]
  node_pdf_export["PDF export"]
  node_xlsx_export["Excel export"]
end

subgraph group_extensions["Budget and sources"]
  node_budgeting["Budgeting<br/>[mis_budget.py]"]
  node_budget_periods["Budget periods"]
  node_committed[("Committed purchases")]
end

node_user(("Report user"))
node_odoo["Odoo platform"]
node_accounting[("Accounting data")]

node_user -->|"configures"| node_templates
node_templates -->|"reuses template"| node_instances
node_user -->|"runs report"| node_instances
node_instances -->|"sets periods"| node_periods
node_instances -->|"drill-down query"| node_accounting_engine
node_templates -->|"uses accounting expressions"| node_accounting_engine
node_templates -->|"evaluates KPIs"| node_expressions
node_templates -->|"fetches other data"| node_data_sources
node_accounting_engine -->|"queries balances"| node_accounting
node_expressions -->|"evaluates safely"| node_safe_eval
node_instances -->|"computes results"| node_kpi_matrix
node_kpi_matrix -->|"evaluates styles"| node_safe_eval
node_kpi_matrix -->|"uses arithmetic"| node_array_values
node_kpi_matrix -->|"renders cells"| node_styles
node_instances -->|"displays interactively"| node_widget
node_widget -->|"edits annotations"| node_annotations
node_instances -->|"exports PDF"| node_pdf_export
node_instances -->|"exports workbook"| node_xlsx_export
node_xlsx_export -->|"converts styles"| node_styles
node_user -->|"adds to dashboard"| node_dashboard
node_dashboard -->|"creates dashboard action"| node_odoo
node_user -->|"maintains budgets"| node_budgeting
node_budgeting -->|"supports budget periods"| node_budget_periods
node_user -.->|"evaluates commitments"| node_committed
node_data_sources -.->|"can use custom source"| node_committed

click node_templates "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report.py"
click node_instances "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance.py"
click node_dashboard "https://github.com/oca/mis-builder/blob/19.0/mis_builder/wizard/mis_builder_dashboard.py"
click node_periods "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance.py"
click node_accounting_engine "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/aep.py"
click node_data_sources "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report.py"
click node_expressions "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/expression_evaluator.py"
click node_safe_eval "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_safe_eval.py"
click node_kpi_matrix "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/kpimatrix.py"
click node_array_values "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/simple_array.py"
click node_styles "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_style.py"
click node_widget "https://github.com/oca/mis-builder/blob/19.0/mis_builder/static/src/components/mis_report_widget.esm.js"
click node_annotations "https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance_annotation.py"
click node_pdf_export "https://github.com/oca/mis-builder/blob/19.0/mis_builder/report/mis_report_instance_qweb.py"
click node_xlsx_export "https://github.com/oca/mis-builder/blob/19.0/mis_builder/report/mis_report_instance_xlsx.py"
click node_budgeting "https://github.com/oca/mis-builder/blob/19.0/mis_builder_budget/models/mis_budget.py"
click node_budget_periods "https://github.com/oca/mis-builder/blob/19.0/mis_builder_budget/models/mis_report_instance_period.py"
click node_committed "https://github.com/oca/mis-builder/blob/19.0/mis_builder_demo/models/mis_committed_purchase.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_templates,node_instances,node_dashboard,node_periods,node_user toneBlue
class node_accounting_engine,node_data_sources,node_expressions,node_safe_eval,node_kpi_matrix,node_array_values,node_accounting toneAmber
class node_styles,node_widget,node_annotations,node_pdf_export,node_xlsx_export toneMint
class node_budgeting,node_budget_periods,node_committed toneRose
class node_odoo toneIndigo
```

## Components

### Report design

- [Report templates](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report.py): `mis_builder/models/mis_report.py`
- [Report instances](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance.py): `mis_builder/models/mis_report_instance.py`
- [Dashboard wizard](https://github.com/oca/mis-builder/blob/19.0/mis_builder/wizard/mis_builder_dashboard.py): `mis_builder/wizard/mis_builder_dashboard.py`
- [Report periods](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance.py): `mis_builder/models/mis_report_instance.py`

### Calculation engine

- [Accounting engine](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/aep.py): `mis_builder/models/aep.py`
- [Other data sources](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report.py): `mis_builder/models/mis_report.py`
- [Expression evaluator](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/expression_evaluator.py): `mis_builder/models/expression_evaluator.py`
- [Safe evaluation](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_safe_eval.py): `mis_builder/models/mis_safe_eval.py`
- [KPI matrix](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/kpimatrix.py): `mis_builder/models/kpimatrix.py`
- [Array arithmetic](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/simple_array.py): `mis_builder/models/simple_array.py`

### Results and exports

- [Report styles](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_style.py): `mis_builder/models/mis_report_style.py`
- [Interactive report](https://github.com/oca/mis-builder/blob/19.0/mis_builder/static/src/components/mis_report_widget.esm.js): `mis_builder/static/src/components/mis_report_widget.esm.js`
- [Cell annotations](https://github.com/oca/mis-builder/blob/19.0/mis_builder/models/mis_report_instance_annotation.py): `mis_builder/models/mis_report_instance_annotation.py`
- [PDF export](https://github.com/oca/mis-builder/blob/19.0/mis_builder/report/mis_report_instance_qweb.py): `mis_builder/report/mis_report_instance_qweb.py`
- [Excel export](https://github.com/oca/mis-builder/blob/19.0/mis_builder/report/mis_report_instance_xlsx.py): `mis_builder/report/mis_report_instance_xlsx.py`

### Budget and sources

- [Budgeting](https://github.com/oca/mis-builder/blob/19.0/mis_builder_budget/models/mis_budget.py): `mis_builder_budget/models/mis_budget.py`
- [Budget periods](https://github.com/oca/mis-builder/blob/19.0/mis_builder_budget/models/mis_report_instance_period.py): `mis_builder_budget/models/mis_report_instance_period.py`
- [Committed purchases](https://github.com/oca/mis-builder/blob/19.0/mis_builder_demo/models/mis_committed_purchase.py): `mis_builder_demo/models/mis_committed_purchase.py`

### Other components

- **Report user**
- **Odoo platform**
- **Accounting data**

## Connections

- Report user → Report templates: configures
- Report templates → Report instances: reuses template
- Report user → Report instances: runs report
- Report instances → Report periods: sets periods (evidence: `mis_builder/models/mis_report_instance.py`)
- Report instances → Accounting engine: drill-down query (evidence: `mis_builder/models/mis_report_instance.py`)
- Report templates → Accounting engine: uses accounting expressions (evidence: `mis_builder/models/mis_report.py`)
- Report templates → Expression evaluator: evaluates KPIs (evidence: `mis_builder/models/mis_report.py`)
- Report templates → Other data sources: fetches other data (evidence: `mis_builder/models/mis_report.py`)
- Accounting engine → Accounting data: queries balances (evidence: `mis_builder/models/aep.py`)
- Expression evaluator → Safe evaluation: evaluates safely (evidence: `mis_builder/models/expression_evaluator.py`)
- Report instances → KPI matrix: computes results (evidence: `mis_builder/models/mis_report_instance.py`)
- KPI matrix → Safe evaluation: evaluates styles (evidence: `mis_builder/models/kpimatrix.py`)
- KPI matrix → Array arithmetic: uses arithmetic (evidence: `mis_builder/models/kpimatrix.py`)
- KPI matrix → Report styles: renders cells (evidence: `mis_builder/models/kpimatrix.py`)
- Report instances → Interactive report: displays interactively
- Interactive report → Cell annotations: edits annotations (evidence: `mis_builder/static/src/components/mis_report_widget.esm.js`)
- Report instances → PDF export: exports PDF
- Report instances → Excel export: exports workbook (evidence: `mis_builder/report/mis_report_instance_xlsx.py`)
- Excel export → Report styles: converts styles (evidence: `mis_builder/report/mis_report_instance_xlsx.py`)
- Report user → Dashboard wizard: adds to dashboard (evidence: `mis_builder/wizard/mis_builder_dashboard.py`)
- Dashboard wizard → Odoo platform: creates dashboard action (evidence: `mis_builder/wizard/mis_builder_dashboard.py`)
- Report user → Budgeting: maintains budgets
- Budgeting → Budget periods: supports budget periods
- Report user → Committed purchases: evaluates commitments
- Other data sources → Committed purchases: can use custom source
