| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Lines of code | 596 |
| Technical Name |
pv_sale_customer_risk_score |
| License | LGPL-3 |
PV: Customer Risk Score for Sales
Customer risk KPIs on partners + a Debtors dashboard (list / pivot / graph) for grouping, sorting and quick analysis.
Module:
pv_sale_customer_risk_score
Odoo 18
LGPL-3
Summary (business view & use-cases)
The module adds an at-a-glance credit risk profile for each customer and a consolidated Debtors view for finance and sales teams. It highlights: Credit Utilization %, Overdue Ratio, recent order activity, and a weighted Risk Score with a Level (Low / Medium / High). Sales can be warned or blocked for high-risk customers.
Typical use-cases
- Collections: Sort customers by Overdue Ratio to focus dunning efforts.
- Sales control: Warn on quotation or block SO confirmation for High risk.
- Credit control: Monitor Credit Utilization % vs Credit Limit.
- Account review: Use Pivot to group by Risk Level and drill down by company or salesperson.
Where to work
- Partner KPIs: open a customer → Risk tab.
- Debtors dashboard: Invoicing → Debtors (list / pivot / graph).
- Configuration: Settings → General Settings → Sales → Customer Risk Score.
Setup guide for beginners
- Install the module. Ensure your user can access the Invoicing app.
- Configure (company-specific):
- Go to Settings → General Settings → Sales → Customer Risk Score.
- Set Activity Window (Days) (e.g.,
120). - Set weights (starting suggestion: Utilization
40, Overdue50, Inactivity10). - Set Low / High thresholds (start with Low
30, High70). - Optional: enable Warn on quotation / Block confirmation if High.
- Prime the data:
- Open any partner → Risk tab → click Recompute Risk to preview KPIs, or
- Run scheduled action PV: Recompute Customer Risk Scores (Settings → Technical → Automation → Scheduled Actions).
- Use the Debtors dashboard:
- Navigate to Invoicing → Debtors.
- Hide/show columns from the column dropdown (per user).
- Switch to Pivot to group by Risk Level, Company, etc.; Graph for quick trends.
Note: Configuration and results are company-aware. Switch your active company before editing settings.
Field explanations
| Field | Location | Explanation |
|---|---|---|
| Activity Window (Days) | Settings → Sales → Customer Risk Score | How many days back to count confirmed/done sales orders for “Orders in Window”. Also shown on Partner → Risk tab. |
| Weight: Credit Utilization | Settings → Sales → Customer Risk Score → Weights | Contribution of Credit Utilization % to the Risk Score. |
| Weight: Overdue Ratio | Settings → Sales → Customer Risk Score → Weights | Contribution of Overdue Ratio to the Risk Score. |
| Weight: Inactivity | Settings → Sales → Customer Risk Score → Weights | Penalty applied if “Orders in Window” is below the configured target. |
| Target orders in window | Settings → Sales → Customer Risk Score → Weights | Sales activity target; falling short increases risk via Inactivity weight. |
| Low threshold (score ≥) | Settings → Sales → Customer Risk Score → Thresholds | Minimum score for Medium risk when below the High threshold. |
| High threshold (score ≥) | Settings → Sales → Customer Risk Score → Thresholds | Minimum score for High risk. |
| Warn on Quotation if Risk | Settings → Sales → Customer Risk Score → Behavior | Shows a warning on quotations for Medium/High risk customers. |
| Block confirmation if High | Settings → Sales → Customer Risk Score → Behavior | Prevents confirming a Sales Order if the customer risk level is High. |
| Credit Utilization % | Partner → Risk | Outstanding / Credit Limit × 100. Outstanding = open AR residuals (posted customer invoices + credit notes). |
| Overdue Ratio | Partner → Risk / Debtors | (Overdue Invoices − Open Credit Notes) / Total Open Invoices. Denominator includes invoices only; credits are subtracted in the numerator. |
| Orders in Window | Partner → Risk / Debtors | Count of confirmed/done sales orders within the Activity Window. |
| Risk Score / Risk Level | Partner → Risk / Debtors | Weighted score based on KPIs; Level derived from Low/High thresholds. |
| Last Updated | Debtors list | Timestamp when the snapshot row was last refreshed by cron. |
Technical overview
Main pieces
- Partner KPIs (computed, not stored): on
res.partner“Risk” tab. - Snapshot model:
pv.debtor.kpistores aggregates for the Debtors dashboard. - Views: list (columns optional per user), pivot (Outstanding, Credit Open, Overdue, Risk Score), graph.
- Cron jobs:
- PV: Recompute Customer Risk Scores — recomputes partner snapshot fields.
- PV: Refresh Debtor KPI — rebuilds
pv.debtor.kpirows.
Key formulas
- Outstanding: sum of
amount_residualon postedout_invoiceandout_refundfor the commercial partner & company. - Overdue invoices: same but due date < today (invoices only).
- Open credit notes: residuals on posted
out_refund(treated as positive when subtracting). - Overdue Ratio:
(Overdue Invoices − Open Credit Notes) / Total Open Invoices(denominator excludes credit notes; ratio is 0 when denominator is 0). - Credit Utilization %:
Outstanding / Credit Limit × 100.
Risk score
Weighted sum of (Credit Util %, Overdue Ratio, Inactivity penalty vs “Target orders in window”). Level mapping: if Score ≥ High → High; else if Score ≥ Low → Medium; else Low.
Access & Menus
- Users need Invoicing access and read on
res.partnerto see Debtors. - Menu: Invoicing → Debtors. Settings panel: Settings → General Settings → Sales → Customer Risk Score.
Setting Low & High thresholds
Where to set them
- Open Settings (with Settings rights).
- Navigate to General Settings → Sales → Customer Risk Score.
- Fill:
- Low threshold (score ≥)
- High threshold (score ≥)
- Click Save.
Company-specific: switch your active company before editing.
How they work
- If Score ≥ High → Level = High.
- Else if Score ≥ Low → Level = Medium.
- Else → Low.
After changing them
- Update immediately by either:
- Partner → Risk → Recompute Risk, or
- Run PV: Recompute Customer Risk Scores cron (Settings → Technical → Scheduled Actions).
- Refresh Debtors via PV: Refresh Debtor KPI if you want the list to update right away.
Quick calibration tips
- Start with Low = 30, High = 70.
- In Invoicing → Debtors, sort by Risk Score:
- Set High where the “risky few” begin (top ~10–20%).
- Set Low where the healthy majority tails off (~30–40).
- Review after a week; tweak to match your tolerance for warnings/blocks.
Please log in to comment on this module