# elgafey/testg architecture

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

- Interactive diagram: https://gitdiagram.com/elgafey/testg
- Repository: https://github.com/elgafey/testg

## Overview

This Odoo add-on lets accounting users allocate a selected set of reconcilable journal items between the original account, an optional bank-and-cash account, and bank-fee expense. The main flow validates the selection, opens a wizard, creates and posts one balanced journal entry, then reconciles it with the selected items. Company settings provide a default fee account; the wizard also supports analytic cost-center allocation. The available excerpts show the entry point and wizard intent, but not all wizard implementation details or view bindings, so those links are documented rather than inferred from unsampled code.

Main entry points: [`bank_fees_allocation/wizard/bank_fees_wizard.py`](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/wizard/bank_fees_wizard.py) (Allocation Wizard), [`bank_fees_allocation/models/account_move_line.py`](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/account_move_line.py) (Selection Handler), [`bank_fees_allocation/views/bank_fees_reconcile_views.xml`](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/bank_fees_reconcile_views.xml) (Reconcile View), [`bank_fees_allocation/models/res_config_settings.py`](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/res_config_settings.py) (Settings Field)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_selection["Selection &amp; Entry"]
  node_reconcile_view["Reconcile View"]
  node_selection_handler["Selection Handler"]
  node_eligibility["Eligibility Checks"]
end

subgraph group_allocation["Fee Allocation"]
  node_wizard_view["Allocation Wizard View"]
  node_allocation_wizard["Allocation Wizard"]
  node_journal_entry[("Journal Entry")]
  node_selected_items[("Selected Journal Items")]
  node_fee_line_view["Entry Cost Center View"]
end

subgraph group_configuration["Company Configuration"]
  node_company_fee_account[("Company Fee Account<br/>[res_company.py]")]
  node_settings_model["Settings Field"]
  node_settings_view["Settings View"]
end

node_accountant(("Accounting User"))
node_odoo_accounting["Odoo Accounting"]

node_accountant -->|"selects items"| node_reconcile_view
node_reconcile_view -->|"opens wizard"| node_selection_handler
node_selection_handler -->|"validates selection"| node_eligibility
node_selection_handler -->|"opens wizard"| node_allocation_wizard
node_allocation_wizard -->|"reads selection"| node_selected_items
node_allocation_wizard -->|"creates and posts"| node_journal_entry
node_allocation_wizard -->|"reconciles with"| node_selected_items
node_allocation_wizard -->|"uses default"| node_company_fee_account
node_settings_view -.->|"edits setting"| node_settings_model
node_settings_model -->|"updates related field"| node_company_fee_account
node_allocation_wizard -->|"posts and reconciles"| node_odoo_accounting

click node_reconcile_view "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/bank_fees_reconcile_views.xml"
click node_selection_handler "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/account_move_line.py"
click node_eligibility "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/account_move_line.py"
click node_wizard_view "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/wizard/bank_fees_wizard_views.xml"
click node_allocation_wizard "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/wizard/bank_fees_wizard.py"
click node_fee_line_view "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/bank_fees_move_views.xml"
click node_company_fee_account "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/res_company.py"
click node_settings_model "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/res_config_settings.py"
click node_settings_view "https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/res_config_settings_views.xml"

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_reconcile_view,node_selection_handler,node_eligibility,node_accountant toneBlue
class node_wizard_view,node_allocation_wizard,node_journal_entry,node_selected_items,node_fee_line_view toneAmber
class node_company_fee_account,node_settings_model,node_settings_view toneMint
class node_odoo_accounting toneIndigo
```

## Components

### Selection & Entry

- [Reconcile View](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/bank_fees_reconcile_views.xml): `bank_fees_allocation/views/bank_fees_reconcile_views.xml`
- [Selection Handler](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/account_move_line.py): `bank_fees_allocation/models/account_move_line.py`
- [Eligibility Checks](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/account_move_line.py): `bank_fees_allocation/models/account_move_line.py`

### Fee Allocation

- [Allocation Wizard View](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/wizard/bank_fees_wizard_views.xml): `bank_fees_allocation/wizard/bank_fees_wizard_views.xml`
- [Allocation Wizard](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/wizard/bank_fees_wizard.py): `bank_fees_allocation/wizard/bank_fees_wizard.py`
- **Journal Entry**
- **Selected Journal Items**
- [Entry Cost Center View](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/bank_fees_move_views.xml): `bank_fees_allocation/views/bank_fees_move_views.xml`

### Company Configuration

- [Company Fee Account](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/res_company.py): `bank_fees_allocation/models/res_company.py`
- [Settings Field](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/models/res_config_settings.py): `bank_fees_allocation/models/res_config_settings.py`
- [Settings View](https://github.com/elgafey/testg/blob/main/bank_fees_allocation/views/res_config_settings_views.xml): `bank_fees_allocation/views/res_config_settings_views.xml`

### Other components

- **Accounting User**
- **Odoo Accounting**

## Connections

- Accounting User → Reconcile View: selects items
- Reconcile View → Selection Handler: opens wizard (evidence: `bank_fees_allocation/models/account_move_line.py`)
- Selection Handler → Eligibility Checks: validates selection (evidence: `bank_fees_allocation/models/account_move_line.py`)
- Selection Handler → Allocation Wizard: opens wizard (evidence: `bank_fees_allocation/models/account_move_line.py`)
- Allocation Wizard → Selected Journal Items: reads selection (evidence: `bank_fees_allocation/wizard/bank_fees_wizard.py`)
- Allocation Wizard → Journal Entry: creates and posts (evidence: `bank_fees_allocation/wizard/bank_fees_wizard.py`)
- Allocation Wizard → Selected Journal Items: reconciles with (evidence: `bank_fees_allocation/wizard/bank_fees_wizard.py`)
- Allocation Wizard → Company Fee Account: uses default
- Settings View → Settings Field: edits setting
- Settings Field → Company Fee Account: updates related field (evidence: `bank_fees_allocation/models/res_config_settings.py`)
- Allocation Wizard → Odoo Accounting: posts and reconciles (evidence: `bank_fees_allocation/wizard/bank_fees_wizard.py`)
