# shohan-nub/nn-fund-management architecture

> Architecture diagram of the GitHub repository shohan-nub/nn-fund-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shohan-nub/nn-fund-management
- Repository: https://github.com/shohan-nub/nn-fund-management

## Overview

1. **Overall shape**
   - This repository is an **Odoo addon/module** named `nn_fund_management`.
   - The architecture is centered on the Odoo ORM and module system: Python models define business logic, XML files define UI and seed data, and security files constrain access.

2. **Primary domain boundary**
   - The module manages a **fund management workflow** with a small set of core business objects:
     - `fund_account`
     - `incoming_fund`
     - `outgoing_fund`
     - `transfer`
     - `allocation`
     - `requisition`
     - `bill`
     - `project`
   - These are the main entities you would place in the domain layer of a diagram.

3. **Money movement and operational flow**
   - The core data flow appears to be:
     - **Incoming funds** are recorded into fund accounts.
     - **Transfers** move balances between fund accounts.
     - **Allocations** distribute funds toward operational needs.
     - **Outgoing funds** represent disbursements or spend events.
   - This forms the transaction backbone of the module.

4. **Approval / request side of the process**
   - `requisition` and `bill` suggest the module also tracks **requested or payable spend items** before or alongside disbursement.
   - `project` provides a business context for where funds are allocated or consumed.
   - In an architecture diagram, these likely sit on the demand/usage side of the fund lifecycle.

5. **Dashboard and reporting surface**
   - `models/dashboard.py` plus `data/dashboard_data.xml` indicate a **dashboard layer** that aggregates module data for operational visibility.
   - The dashboard is probably the main read-oriented entry point, summarizing accounts, balances, allocations, or pending items.

6. **Multi-company and tenant boundaries**
   - `models/company_mixin.py` indicates shared logic around **company scoping**.
   - This suggests records are filtered or validated by company, making company boundaries an important part of the architecture.

7. **Access control and policy enforcement**
   - Security is implemented with:
     - `security/ir.model.access.csv` for model-level permissions
     - `security/record_rules.xml` for row-level restrictions
     - `security.xml` for roles/groups or security definitions
   - This is a significant boundary: users can see or act on only the funds and records allowed by their role/company scope.

8. **Supporting utilities and shared logic**
   - `models/security_utils.py` indicates helper functions for permission or record-rule related checks.
   - The module likely centralizes reusable authorization logic rather than embedding it in each model.

9. **Presentation layer**
   - XML views under `views/` define forms, lists, and possibly dashboards for each business object.
   - `static/src/scss/fund_management.scss` provides module-specific styling for the Odoo UI.
   - These files form the user-facing layer, separate from the business logic in Python.

10. **Initialization and module wiring**
   - `__manifest__.py` defines the addon’s metadata, dependencies, data loading order, and install hooks.
   - `__init__.py` files wire the package into Odoo and load model definitions.
   - `data/sequence.xml` suggests autogenerated numbering for transaction records, which is a common workflow requirement in accounting-style modules.

11. **Deployment/runtime context**
   - The presence of `docker-compose.yml` indicates the module is intended to run in a **containerized Odoo environment**.
   - The repo does not appear to include a standalone backend or frontend application; instead, it extends an existing Odoo deployment.

12. **How to draw the architecture**
   - A good diagram would show:
     - **Odoo runtime / framework** at the center
     - **Fund management models** as the core business services
     - **Views/UI** as the user interaction layer
     - **Security rules** as a cross-cutting control layer
     - **Sequences and dashboard seed data** as supporting initialization inputs
     - **Multi-company scoping** as a horizontal constraint across all records

Main entry points: [`addons/nn_fund_management/models/__init__.py`](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/__init__.py) (Models init), [`addons/nn_fund_management/security/ir.model.access.csv`](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/ir.model.access.csv) (Model access), [`addons/nn_fund_management/security/record_rules.xml`](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/record_rules.xml) (Record rules), [`addons/nn_fund_management/models/company_mixin.py`](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/company_mixin.py) (Company mixin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Odoo runtime"]
end

subgraph group_domain["Fund domain"]
  node_fund_account[("Fund account<br/>account model<br/>[fund_account.py]")]
  node_incoming_fund[("Incoming fund<br/>receipt model<br/>[incoming_fund.py]")]
  node_transfer[("Transfer<br/>movement model<br/>[transfer.py]")]
  node_allocation[("Allocation<br/>distribution model<br/>[allocation.py]")]
  node_outgoing_fund[("Outgoing fund<br/>disbursement model<br/>[outgoing_fund.py]")]
  node_requisition[("Requisition<br/>request model<br/>[requisition.py]")]
  node_bill[("Bill<br/>payable model<br/>[bill.py]")]
  node_project[("Project<br/>context model<br/>[project.py]")]
end

subgraph group_access["Security"]
  node_company_mixin["Company mixin<br/>scoping mixin<br/>[company_mixin.py]"]
  node_security_utils["Security utils<br/>access helpers<br/>[security_utils.py]"]
  node_access_csv["Model access<br/>permissions"]
  node_record_rules["Record rules<br/>row security<br/>[record_rules.xml]"]
  node_security_xml["Security defs<br/>roles/groups<br/>[security.xml]"]
end

subgraph group_ui["Presentation"]
  node_dashboard(("Dashboard<br/>aggregator<br/>[dashboard.py]"))
  node_fund_views["Fund views<br/>forms/lists"]
  node_txn_views["Txn views<br/>forms/lists"]
  node_ops_views["Ops views<br/>forms/lists"]
  node_dashboard_views["Dashboard views<br/>dashboard UI"]
  node_style["Styles<br/>scss"]
end

subgraph group_boot["Bootstrap"]
  node_manifest["Manifest<br/>addon metadata<br/>[__manifest__.py]"]
  node_init["Init<br/>package wiring<br/>[__init__.py]"]
  node_models_init["Models init<br/>model loader<br/>[__init__.py]"]
  node_sequence_data["Sequences<br/>seed data<br/>[sequence.xml]"]
  node_dashboard_data["Dashboard data<br/>seed data<br/>[dashboard_data.xml]"]
end

node_manifest -->|"loads"| node_init
node_init -->|"imports"| node_models_init
node_manifest -->|"includes"| node_sequence_data
node_manifest -->|"includes"| node_dashboard_data
node_models_init -->|"loads"| node_fund_account
node_models_init -->|"loads"| node_incoming_fund
node_models_init -->|"loads"| node_transfer
node_models_init -->|"loads"| node_allocation
node_models_init -->|"loads"| node_outgoing_fund
node_models_init -->|"loads"| node_requisition
node_models_init -->|"loads"| node_bill
node_models_init -->|"loads"| node_project
node_models_init -->|"loads"| node_dashboard
node_company_mixin -.->|"scopes"| node_fund_account
node_company_mixin -.->|"scopes"| node_incoming_fund
node_company_mixin -.->|"scopes"| node_transfer
node_company_mixin -.->|"scopes"| node_allocation
node_company_mixin -.->|"scopes"| node_outgoing_fund
node_company_mixin -.->|"scopes"| node_requisition
node_company_mixin -.->|"scopes"| node_bill
node_company_mixin -.->|"scopes"| node_project
node_security_utils -.->|"supports"| node_record_rules
node_security_utils -.->|"supports"| node_security_xml
node_access_csv -->|"permits"| node_fund_account
node_access_csv -->|"permits"| node_incoming_fund
node_access_csv -->|"permits"| node_transfer
node_access_csv -->|"permits"| node_allocation
node_access_csv -->|"permits"| node_outgoing_fund
node_access_csv -->|"permits"| node_requisition
node_access_csv -->|"permits"| node_bill
node_access_csv -->|"permits"| node_project
node_record_rules -->|"restricts"| node_fund_account
node_record_rules -->|"restricts"| node_incoming_fund
node_record_rules -->|"restricts"| node_transfer
node_record_rules -->|"restricts"| node_allocation
node_record_rules -->|"restricts"| node_outgoing_fund
node_record_rules -->|"restricts"| node_requisition
node_record_rules -->|"restricts"| node_bill
node_record_rules -->|"restricts"| node_project
node_security_xml -.->|"governs"| node_access_csv
node_incoming_fund -->|"credits"| node_fund_account
node_transfer -->|"moves"| node_fund_account
node_allocation -->|"allocates"| node_fund_account
node_outgoing_fund -->|"debits"| node_fund_account
node_requisition -->|"requests"| node_allocation
node_bill -->|"settles"| node_outgoing_fund
node_project -->|"context"| node_allocation
node_dashboard -->|"summarizes"| node_fund_account

click node_manifest "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/__manifest__.py"
click node_init "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/__init__.py"
click node_models_init "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/__init__.py"
click node_sequence_data "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/data/sequence.xml"
click node_dashboard_data "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/data/dashboard_data.xml"
click node_company_mixin "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/company_mixin.py"
click node_security_utils "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/security_utils.py"
click node_access_csv "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/ir.model.access.csv"
click node_record_rules "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/record_rules.xml"
click node_security_xml "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/security.xml"
click node_fund_account "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/fund_account.py"
click node_incoming_fund "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/incoming_fund.py"
click node_transfer "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/transfer.py"
click node_allocation "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/allocation.py"
click node_outgoing_fund "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/outgoing_fund.py"
click node_requisition "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/requisition.py"
click node_bill "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/bill.py"
click node_project "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/project.py"
click node_dashboard "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/dashboard.py"
click node_fund_views "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/fund_account_views.xml"
click node_txn_views "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/incoming_fund_views.xml"
click node_ops_views "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/requisition_views.xml"
click node_dashboard_views "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/dashboard_views.xml"
click node_style "https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/static/src/scss/fund_management.scss"

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_fund_account,node_incoming_fund,node_transfer,node_allocation,node_outgoing_fund,node_requisition,node_bill,node_project toneAmber
class node_company_mixin,node_security_utils,node_access_csv,node_record_rules,node_security_xml toneMint
class node_dashboard,node_fund_views,node_txn_views,node_ops_views,node_dashboard_views,node_style toneRose
class node_manifest,node_init,node_models_init,node_sequence_data,node_dashboard_data toneIndigo
```

## Components

### Fund domain

Core fund management business objects and workflow.

- [Fund account](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/fund_account.py): account model · Primary balance-holding entity for funds. · `addons/nn_fund_management/models/fund_account.py`
- [Incoming fund](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/incoming_fund.py): receipt model · Records money entering a fund account. · `addons/nn_fund_management/models/incoming_fund.py`
- [Transfer](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/transfer.py): movement model · Moves balances between fund accounts. · `addons/nn_fund_management/models/transfer.py`
- [Allocation](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/allocation.py): distribution model · Assigns funds toward operational needs. · `addons/nn_fund_management/models/allocation.py`
- [Outgoing fund](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/outgoing_fund.py): disbursement model · Captures fund spend or payout events. · `addons/nn_fund_management/models/outgoing_fund.py`
- [Requisition](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/requisition.py): request model · Represents requested spend or funding demand. · `addons/nn_fund_management/models/requisition.py`
- [Bill](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/bill.py): payable model · Tracks payable items tied to fund usage. · `addons/nn_fund_management/models/bill.py`
- [Project](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/project.py): context model · Business context for allocation and consumption. · `addons/nn_fund_management/models/project.py`

### Security

Permissions, record rules, and shared access helpers.

- [Company mixin](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/company_mixin.py): scoping mixin · Shared company-boundary logic used across records. · `addons/nn_fund_management/models/company_mixin.py`
- [Security utils](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/security_utils.py): access helpers · Reusable helpers for permission and rule checks. · `addons/nn_fund_management/models/security_utils.py`
- [Model access](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/ir.model.access.csv): permissions · Model-level access control definitions. · `addons/nn_fund_management/security/ir.model.access.csv`
- [Record rules](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/record_rules.xml): row security · Row-level visibility and action restrictions. · `addons/nn_fund_management/security/record_rules.xml`
- [Security defs](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/security/security.xml): roles/groups · Security groups or related access definitions. · `addons/nn_fund_management/security/security.xml`

### Presentation

Views, dashboard surfaces, and styling.

- [Dashboard](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/dashboard.py): aggregator · Read-oriented summary of fund activity and status. · `addons/nn_fund_management/models/dashboard.py`
- [Fund views](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/fund_account_views.xml): forms/lists · User interface for fund accounts and transactions. · `addons/nn_fund_management/views/fund_account_views.xml`
- [Txn views](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/incoming_fund_views.xml): forms/lists · UI for incoming, transfer, allocation, and outgoing records. · `addons/nn_fund_management/views/incoming_fund_views.xml`
- [Ops views](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/requisition_views.xml): forms/lists · UI for requisitions, bills, and projects. · `addons/nn_fund_management/views/requisition_views.xml`
- [Dashboard views](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/views/dashboard_views.xml): dashboard UI · Presentation for aggregated operational visibility. · `addons/nn_fund_management/views/dashboard_views.xml`
- [Styles](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/static/src/scss/fund_management.scss): scss · Module-specific UI styling. · `addons/nn_fund_management/static/src/scss/fund_management.scss`

### Bootstrap

Module initialization and seed data.

- [Manifest](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/__manifest__.py): addon metadata · Declares dependencies, data files, and module configuration. · `addons/nn_fund_management/__manifest__.py`
- [Init](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/__init__.py): package wiring · Loads the addon package and model modules. · `addons/nn_fund_management/__init__.py`
- [Models init](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/models/__init__.py): model loader · Imports the model package modules. · `addons/nn_fund_management/models/__init__.py`
- [Sequences](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/data/sequence.xml): seed data · Defines record numbering for operational documents. · `addons/nn_fund_management/data/sequence.xml`
- [Dashboard data](https://github.com/shohan-nub/nn-fund-management/blob/main/addons/nn_fund_management/data/dashboard_data.xml): seed data · Provides initial dashboard configuration or content. · `addons/nn_fund_management/data/dashboard_data.xml`

## Connections

- Manifest → Init: loads · Module bootstrap starts package loading.
- Init → Models init: imports · Package initialization loads model definitions.
- Manifest → Sequences: includes · Manifest installs sequence seed data.
- Manifest → Dashboard data: includes · Manifest installs dashboard seed data.
- Models init → Fund account: loads · Model package exposes the core entities.
- Models init → Incoming fund: loads · Model package exposes the core entities.
- Models init → Transfer: loads · Model package exposes the core entities.
- Models init → Allocation: loads · Model package exposes the core entities.
- Models init → Outgoing fund: loads · Model package exposes the core entities.
- Models init → Requisition: loads · Model package exposes the core entities.
- Models init → Bill: loads · Model package exposes the core entities.
- Models init → Project: loads · Model package exposes the core entities.
- Models init → Dashboard: loads · Model package exposes the dashboard aggregator.
- Company mixin → Fund account: scopes · Company boundary applies to fund records.
- Company mixin → Incoming fund: scopes · Company boundary applies to fund records.
- Company mixin → Transfer: scopes · Company boundary applies to fund records.
- Company mixin → Allocation: scopes · Company boundary applies to fund records.
- Company mixin → Outgoing fund: scopes · Company boundary applies to fund records.
- Company mixin → Requisition: scopes · Company boundary applies to fund records.
- Company mixin → Bill: scopes · Company boundary applies to fund records.
- Company mixin → Project: scopes · Company boundary applies to fund records.
- Security utils → Record rules: supports · Shared helpers back record-level restrictions.
- Security utils → Security defs: supports · Shared helpers back security definitions.
- Model access → Fund account: permits · Defines access rights for models.
- Model access → Incoming fund: permits · Defines access rights for models.
- Model access → Transfer: permits · Defines access rights for models.
- Model access → Allocation: permits · Defines access rights for models.
- Model access → Outgoing fund: permits · Defines access rights for models.
- Model access → Requisition: permits · Defines access rights for models.
- Model access → Bill: permits · Defines access rights for models.
- Model access → Project: permits · Defines access rights for models.
- Record rules → Fund account: restricts · Row rules constrain record visibility.
- Record rules → Incoming fund: restricts · Row rules constrain record visibility.
- Record rules → Transfer: restricts · Row rules constrain record visibility.
- Record rules → Allocation: restricts · Row rules constrain record visibility.
- Record rules → Outgoing fund: restricts · Row rules constrain record visibility.
- Record rules → Requisition: restricts · Row rules constrain record visibility.
- Record rules → Bill: restricts · Row rules constrain record visibility.
- Record rules → Project: restricts · Row rules constrain record visibility.
- Security defs → Model access: governs · Role definitions underpin model access.
- Incoming fund → Fund account: credits · Incoming money is recorded into fund accounts.
- Transfer → Fund account: moves · Transfers shift balances between accounts.
- Allocation → Fund account: allocates · Allocations draw from or reserve account funds.
- Outgoing fund → Fund account: debits · Outgoing disbursements reduce account balances.
- Requisition → Allocation: requests · Requisitions feed the allocation workflow.
- Bill → Outgoing fund: settles · Bills are paid through outgoing funds.
- Project → Allocation: context · Projects provide the operational context for allocations.
- Dashboard → Fund account: summarizes · Dashboard aggregates account and balance data.
