# oca/crm architecture

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

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

## Overview

This repository is a suite of Odoo CRM addons, not a standalone application: it extends lead/opportunity handling with claim and call tracking, qualification fields, stage controls, and conversions into project or purchasing work. Users work through Odoo’s CRM records and addon actions; results include managed claims and calls, linked tasks or RFQs, and reporting views. The README documents the addon capabilities, while sampled code confirms selected internal links. Many addon implementations were not sampled, so their internal call paths are not inferred.

Main entry points: [`crm_phonecall/models/crm_phonecall.py`](https://github.com/oca/crm/blob/19.0/crm_phonecall/models/crm_phonecall.py) (Phone calls), [`crm_lead_to_task/models/crm_lead.py`](https://github.com/oca/crm/blob/19.0/crm_lead_to_task/models/crm_lead.py) (Lead-to-task), [`crm_project_task/models/crm_lead.py`](https://github.com/oca/crm/blob/19.0/crm_project_task/models/crm_lead.py) (Project tasks), [`srm/models/crm_lead.py`](https://github.com/oca/crm/blob/19.0/srm/models/crm_lead.py) (Supplier opportunities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crm_work["CRM extensions"]
  node_lead_enrichment["Lead enrichment<br/>[crm_lead.py]"]
  node_lead_identity["Lead identifiers<br/>[crm_lead.py]"]
  node_lead_currency["Lead currency<br/>[crm_lead.py]"]
  node_lead_contact["Lead contacts<br/>[crm_lead.py]"]
  node_lead_vat["Lead VAT<br/>[crm_lead.py]"]
  node_lead_location["Lead location<br/>[crm_lead.py]"]
  node_partner_assignment["Partner assignment<br/>[crm_lead.py]"]
  node_lost_reason["Lost reason rule"]
  node_stage_probability["Stage probability<br/>[crm_lead.py]"]
  node_probability_update["Probability update"]
  node_won_stage_rule["Won-stage rule<br/>[crm_lead.py]"]
  node_marketing_partner["Partner tracking<br/>[res_partner.py]"]
end

subgraph group_service["Claims and calls"]
  node_claim_records["Claim management<br/>[crm_claim.py]"]
  node_claim_code["Claim identifiers<br/>[crm_claim.py]"]
  node_phonecall_records["Phone calls<br/>[crm_phonecall.py]"]
  node_phonecall_schedule["Call scheduling"]
  node_phonecall_summary["Call summaries<br/>[crm_phonecall.py]"]
end

subgraph group_delivery["Project workflow"]
  node_lead_task_convert["Lead-to-task<br/>[crm_lead.py]"]
  node_task_conversion_wizard["Task conversion wizard"]
  node_project_create["Project creation"]
  node_project_task["Project tasks<br/>[crm_lead.py]"]
  node_task_wizard["Task creation wizard<br/>[crm_create_task.py]"]
end

subgraph group_sales["Supplier workflow"]
  node_supplier_lead["Supplier opportunities<br/>[crm_lead.py]"]
  node_rfq_conversion["RFQ conversion"]
end

subgraph group_insights["Reporting"]
  node_claim_report[("Claim analytics")]
  node_phonecall_report[("Call analytics")]
end

node_user(("Odoo user"))

node_user -->|"enriches leads"| node_lead_enrichment
node_user -->|"uses lead codes"| node_lead_identity
node_user -->|"views currency"| node_lead_currency
node_user -->|"enters names"| node_lead_contact
node_user -->|"enters VAT"| node_lead_vat
node_user -->|"uses location"| node_lead_location
node_user -->|"assigns partners"| node_partner_assignment
node_user -->|"closes leads"| node_lost_reason
node_user -->|"sets stage"| node_stage_probability
node_probability_update -->|"updates probability"| node_stage_probability
node_user -->|"marks opportunities won"| node_won_stage_rule
node_user -->|"tracks partners"| node_marketing_partner
node_user -->|"tracks claims"| node_claim_records
node_user -->|"uses claim codes"| node_claim_code
node_claim_report -->|"reads claim data"| node_claim_records
node_user -->|"manages calls"| node_phonecall_records
node_phonecall_records -->|"feeds call report"| node_phonecall_report
node_user -->|"schedules calls"| node_phonecall_schedule
node_user -->|"chooses summaries"| node_phonecall_summary
node_user -->|"converts leads"| node_lead_task_convert
node_lead_task_convert -->|"opens wizard"| node_task_conversion_wizard
node_user -->|"creates projects"| node_project_create
node_user -->|"creates tasks"| node_project_task
node_project_task -->|"offers wizard"| node_task_wizard
node_user -->|"manages suppliers"| node_supplier_lead
node_supplier_lead -->|"prepares RFQs"| node_rfq_conversion
node_phonecall_records -->|"creates opportunity"| node_lead_enrichment

click node_lead_enrichment "https://github.com/oca/crm/blob/19.0/crm_industry/models/crm_lead.py"
click node_lead_identity "https://github.com/oca/crm/blob/19.0/crm_lead_code/models/crm_lead.py"
click node_lead_currency "https://github.com/oca/crm/blob/19.0/crm_lead_currency/models/crm_lead.py"
click node_lead_contact "https://github.com/oca/crm/blob/19.0/crm_lead_firstname/models/crm_lead.py"
click node_lead_vat "https://github.com/oca/crm/blob/19.0/crm_lead_vat/models/crm_lead.py"
click node_lead_location "https://github.com/oca/crm/blob/19.0/crm_location/models/crm_lead.py"
click node_partner_assignment "https://github.com/oca/crm/blob/19.0/crm_partner_assign/models/crm_lead.py"
click node_lost_reason "https://github.com/oca/crm/tree/19.0/crm_lost_reason_required"
click node_stage_probability "https://github.com/oca/crm/blob/19.0/crm_stage_probability/models/crm_lead.py"
click node_probability_update "https://github.com/oca/crm/blob/19.0/crm_stage_probability/wizard/crm_lead_stage_probability_update.py"
click node_won_stage_rule "https://github.com/oca/crm/blob/19.0/crm_won_restrict_per_stage/models/crm_lead.py"
click node_marketing_partner "https://github.com/oca/crm/blob/19.0/marketing_crm_partner/models/res_partner.py"
click node_claim_records "https://github.com/oca/crm/blob/19.0/crm_claim/models/crm_claim.py"
click node_claim_code "https://github.com/oca/crm/blob/19.0/crm_claim_code/models/crm_claim.py"
click node_claim_report "https://github.com/oca/crm/blob/19.0/crm_claim/report/crm_claim_report.py"
click node_phonecall_records "https://github.com/oca/crm/blob/19.0/crm_phonecall/models/crm_phonecall.py"
click node_phonecall_schedule "https://github.com/oca/crm/blob/19.0/crm_phonecall/wizard/crm_phonecall_to_phonecall.py"
click node_phonecall_summary "https://github.com/oca/crm/blob/19.0/crm_phonecall_summary_predefined/models/crm_phonecall.py"
click node_phonecall_report "https://github.com/oca/crm/blob/19.0/crm_phonecall/report/crm_phonecall_report.py"
click node_lead_task_convert "https://github.com/oca/crm/blob/19.0/crm_lead_to_task/models/crm_lead.py"
click node_task_conversion_wizard "https://github.com/oca/crm/blob/19.0/crm_lead_to_task/wizard/crm_lead_convert2task.py"
click node_project_create "https://github.com/oca/crm/blob/19.0/crm_project_create/wizards/crm_create_project.py"
click node_project_task "https://github.com/oca/crm/blob/19.0/crm_project_task/models/crm_lead.py"
click node_task_wizard "https://github.com/oca/crm/blob/19.0/crm_project_task/wizards/crm_create_task.py"
click node_supplier_lead "https://github.com/oca/crm/blob/19.0/srm/models/crm_lead.py"
click node_rfq_conversion "https://github.com/oca/crm/blob/19.0/srm/wizard/srm_opportunity_to_rfq.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_lead_enrichment,node_lead_identity,node_lead_currency,node_lead_contact,node_lead_vat,node_lead_location,node_partner_assignment,node_lost_reason,node_stage_probability,node_probability_update,node_won_stage_rule,node_marketing_partner,node_user toneBlue
class node_claim_records,node_claim_code,node_phonecall_records,node_phonecall_schedule,node_phonecall_summary toneAmber
class node_lead_task_convert,node_task_conversion_wizard,node_project_create,node_project_task,node_task_wizard toneMint
class node_supplier_lead,node_rfq_conversion toneRose
class node_claim_report,node_phonecall_report toneIndigo
```

## Components

### CRM extensions

- [Lead enrichment](https://github.com/oca/crm/blob/19.0/crm_industry/models/crm_lead.py): `crm_industry/models/crm_lead.py`
- [Lead identifiers](https://github.com/oca/crm/blob/19.0/crm_lead_code/models/crm_lead.py): `crm_lead_code/models/crm_lead.py`
- [Lead currency](https://github.com/oca/crm/blob/19.0/crm_lead_currency/models/crm_lead.py): `crm_lead_currency/models/crm_lead.py`
- [Lead contacts](https://github.com/oca/crm/blob/19.0/crm_lead_firstname/models/crm_lead.py): `crm_lead_firstname/models/crm_lead.py`
- [Lead VAT](https://github.com/oca/crm/blob/19.0/crm_lead_vat/models/crm_lead.py): `crm_lead_vat/models/crm_lead.py`
- [Lead location](https://github.com/oca/crm/blob/19.0/crm_location/models/crm_lead.py): `crm_location/models/crm_lead.py`
- [Partner assignment](https://github.com/oca/crm/blob/19.0/crm_partner_assign/models/crm_lead.py): `crm_partner_assign/models/crm_lead.py`
- [Lost reason rule](https://github.com/oca/crm/tree/19.0/crm_lost_reason_required): `crm_lost_reason_required`
- [Stage probability](https://github.com/oca/crm/blob/19.0/crm_stage_probability/models/crm_lead.py): `crm_stage_probability/models/crm_lead.py`
- [Probability update](https://github.com/oca/crm/blob/19.0/crm_stage_probability/wizard/crm_lead_stage_probability_update.py): `crm_stage_probability/wizard/crm_lead_stage_probability_update.py`
- [Won-stage rule](https://github.com/oca/crm/blob/19.0/crm_won_restrict_per_stage/models/crm_lead.py): `crm_won_restrict_per_stage/models/crm_lead.py`
- [Partner tracking](https://github.com/oca/crm/blob/19.0/marketing_crm_partner/models/res_partner.py): `marketing_crm_partner/models/res_partner.py`

### Claims and calls

- [Claim management](https://github.com/oca/crm/blob/19.0/crm_claim/models/crm_claim.py): `crm_claim/models/crm_claim.py`
- [Claim identifiers](https://github.com/oca/crm/blob/19.0/crm_claim_code/models/crm_claim.py): `crm_claim_code/models/crm_claim.py`
- [Phone calls](https://github.com/oca/crm/blob/19.0/crm_phonecall/models/crm_phonecall.py): `crm_phonecall/models/crm_phonecall.py`
- [Call scheduling](https://github.com/oca/crm/blob/19.0/crm_phonecall/wizard/crm_phonecall_to_phonecall.py): `crm_phonecall/wizard/crm_phonecall_to_phonecall.py`
- [Call summaries](https://github.com/oca/crm/blob/19.0/crm_phonecall_summary_predefined/models/crm_phonecall.py): `crm_phonecall_summary_predefined/models/crm_phonecall.py`

### Project workflow

- [Lead-to-task](https://github.com/oca/crm/blob/19.0/crm_lead_to_task/models/crm_lead.py): `crm_lead_to_task/models/crm_lead.py`
- [Task conversion wizard](https://github.com/oca/crm/blob/19.0/crm_lead_to_task/wizard/crm_lead_convert2task.py): `crm_lead_to_task/wizard/crm_lead_convert2task.py`
- [Project creation](https://github.com/oca/crm/blob/19.0/crm_project_create/wizards/crm_create_project.py): `crm_project_create/wizards/crm_create_project.py`
- [Project tasks](https://github.com/oca/crm/blob/19.0/crm_project_task/models/crm_lead.py): `crm_project_task/models/crm_lead.py`
- [Task creation wizard](https://github.com/oca/crm/blob/19.0/crm_project_task/wizards/crm_create_task.py): `crm_project_task/wizards/crm_create_task.py`

### Supplier workflow

- [Supplier opportunities](https://github.com/oca/crm/blob/19.0/srm/models/crm_lead.py): `srm/models/crm_lead.py`
- [RFQ conversion](https://github.com/oca/crm/blob/19.0/srm/wizard/srm_opportunity_to_rfq.py): `srm/wizard/srm_opportunity_to_rfq.py`

### Reporting

- [Claim analytics](https://github.com/oca/crm/blob/19.0/crm_claim/report/crm_claim_report.py): `crm_claim/report/crm_claim_report.py`
- [Call analytics](https://github.com/oca/crm/blob/19.0/crm_phonecall/report/crm_phonecall_report.py): `crm_phonecall/report/crm_phonecall_report.py`

### Other components

- **Odoo user**

## Connections

- Odoo user → Lead enrichment: enriches leads
- Odoo user → Lead identifiers: uses lead codes
- Odoo user → Lead currency: views currency
- Odoo user → Lead contacts: enters names
- Odoo user → Lead VAT: enters VAT
- Odoo user → Lead location: uses location
- Odoo user → Partner assignment: assigns partners
- Odoo user → Lost reason rule: closes leads
- Odoo user → Stage probability: sets stage
- Probability update → Stage probability: updates probability (evidence: `crm_stage_probability/wizard/crm_lead_stage_probability_update.py`)
- Odoo user → Won-stage rule: marks opportunities won
- Odoo user → Partner tracking: tracks partners
- Odoo user → Claim management: tracks claims
- Odoo user → Claim identifiers: uses claim codes
- Claim analytics → Claim management: reads claim data (evidence: `crm_claim/report/crm_claim_report.py`)
- Odoo user → Phone calls: manages calls
- Phone calls → Call analytics: feeds call report (evidence: `crm_phonecall/report/crm_phonecall_report.py`)
- Odoo user → Call scheduling: schedules calls
- Odoo user → Call summaries: chooses summaries
- Odoo user → Lead-to-task: converts leads
- Lead-to-task → Task conversion wizard: opens wizard (evidence: `crm_lead_to_task/models/crm_lead.py`)
- Odoo user → Project creation: creates projects
- Odoo user → Project tasks: creates tasks
- Project tasks → Task creation wizard: offers wizard (evidence: `crm_project_task/models/crm_lead.py`)
- Odoo user → Supplier opportunities: manages suppliers
- Supplier opportunities → RFQ conversion: prepares RFQs (evidence: `srm/models/crm_lead.py`)
- Phone calls → Lead enrichment: creates opportunity (evidence: `crm_phonecall/models/crm_phonecall.py`)
