Dynamic Payment Terms Engine
Deterministic Credit Risk Governance for Odoo 18
A structured, rule-driven module that automatically assigns the correct payment terms to every Sales Order and Customer Invoice — based on quantified customer risk, outstanding exposure, and payment behavior — without relying on manual judgment or static configurations.
The Problem This Module Solves
In most Odoo deployments, payment terms are set manually — once, at partner creation — and rarely updated. A customer classified as low-risk at onboarding may accumulate overdue invoices, deteriorating payment behavior, and growing outstanding exposure over months, while continuing to receive the same favorable 60-day terms they were assigned on day one.
Finance teams compensate with manual reviews, spreadsheet exports, and judgment calls that introduce inconsistency, human error, and no audit trail. Auditors and CFOs have no reliable record of why a particular payment term was applied to a given invoice.
The Dynamic Payment Terms Engine replaces this process with a deterministic, rule-based system that continuously evaluates customer risk and enforces the correct payment policy at the point of document creation — automatically, consistently, and with a complete log of every decision.
Executive Risk Intelligence Dashboard
The built-in OWL dashboard provides Finance Directors and CFOs with an immediate, company-wide view of the customer credit risk portfolio. It loads live data on every open and refreshes automatically every 60 seconds, requiring no manual intervention.
Key indicators visible at a glance include: the number of High and Critical risk customers, the portfolio-wide average risk score, total outstanding receivable exposure, and the distribution of customers across all four risk classes. Quick-access shortcuts link directly to each underlying analytical view.
The dashboard is designed to surface actionable intelligence — not raw data — enabling finance leadership to identify deteriorating segments and concentration risk without navigating through individual partner records.
Explainable, Deterministic Risk Scoring
Every customer receives a numeric risk score between 0 and 100, computed from three independently weighted dimensions of payment behavior: late payment frequency, average days past due, and the ratio of open receivables to total invoiced revenue over the trailing 12 months.
The formula is fully deterministic. Given identical input data, it will always produce the same score. There are no black-box models, no machine learning, and no probabilistic estimates. This ensures that scores are auditable, reproducible, and defensible to external auditors and finance controllers.
Risk scores are translated into four classes — Low, Medium, High, and Critical — each with a configurable threshold. The module also tracks the direction of change over time, classifying each customer as Improving, Stable, or Deteriorating based on score evolution. Deteriorating customers are surfaced prominently in the dashboard.
Risk metrics are recomputed on a configurable schedule via Odoo's standard cron infrastructure. Batch processing with configurable limits ensures that recomputation does not overload production instances.
Sequence-Based Payment Risk Rule Engine
Payment term assignment is governed by an ordered set of rules, each evaluated in sequence until a match is found. Rules combine multiple conditions simultaneously: risk score range, risk class, risk trend direction, customer outstanding exposure, and transaction amount. When all conditions of a rule are met, the corresponding payment term is applied.
This architecture provides complete flexibility without requiring custom development. Finance teams can define as many rules as needed, reorder them via drag-and-drop, enable or disable individual rules, and assign company-specific rule sets in multi-company environments.
Each rule carries a human-readable label and an optional description, ensuring that rule intent remains clear to both system administrators and auditors reviewing the configuration.
Sales Order Integration
Payment term governance begins at the Sales Order, not the invoice. When a Sales Order is confirmed or a customer is changed, the engine evaluates the applicable rule set and assigns the correct payment term immediately — before any invoice is generated.
Sales representatives work within the policy set by the finance team, without needing to understand the underlying risk criteria. The correct term appears automatically. Any manual change by a user is flagged as an override and logged with the full audit context.
When the Sales Order is invoiced, the payment term is carried through consistently. The invoice records the risk snapshot at the time of validation, providing a permanent record of the conditions that justified the applied term.
Customer Invoice Automation
On every customer invoice — whether created manually, generated from a Sales Order, or produced by any automation — the engine applies the current applicable rule and updates the payment term accordingly. This occurs on creation, on partner change, on amount update, and on validation (posting).
Each invoice records a complete risk snapshot at the moment of validation: risk score, risk class, risk trend, outstanding exposure, reliability index, and average days late. This snapshot is immutable and provides the audit evidence for why a particular term was applied on that specific document on that specific date.
A dedicated Payment Risk tab on the invoice form surfaces all governance metadata to authorised users, without cluttering the standard invoice layout for users who do not require this information.
Governance and Audit Logging
Every payment term change — whether applied automatically by the rule engine or manually overridden by a user — generates an immutable audit log entry. Each entry records the document reference, the previous and new payment terms, the risk score at the time of change, the rule applied (if any), the override flag, and the timestamp.
Manual overrides require the overriding user to provide a written justification. This justification is stored on the document and replicated to the audit log, creating a traceable chain of custody for every payment term decision in the system.
The audit log is accessible to risk managers via a dedicated list view with pivot and graph analysis capabilities. Override frequency analysis identifies patterns of systematic policy circumvention — a key control for finance governance teams.
Multi-Company Safety and Role-Based Access
The module is fully multi-company-safe. Risk rules, audit logs, and dashboard records are scoped per company. Risk metrics are computed in the correct company context. Payment term assignments respect the company of the source document.
Access to risk intelligence is controlled by two dedicated security groups: Risk User (read access to scoring data and application status) and Risk Manager (full access including rule configuration, override controls, and audit log review). These groups can be assigned independently of existing Odoo accounting roles.
All module settings are managed through the standard Odoo Settings interface, with individual toggles for each major feature: dynamic term assignment, override logging, and automatic application on invoices. Features can be disabled selectively without uninstalling the module.
Technical Specifications
The module is built exclusively on Odoo 18 standard APIs. It uses the new
_read_group aggregate API, OWL 2 component architecture for the
dashboard, and standard ir.cron infrastructure for scheduled
recomputation. No external Python dependencies are introduced.
The risk score computation is performed in Python on stored fields, ensuring that scores are filterable, sortable, and usable as pivot measures in Odoo's standard reporting engine without any custom query layer.
- Odoo version: 18.0
- License: OPL-1 (Odoo Proprietary License)
- Dependencies: account, sale_management, mail
- Frontend: OWL 2, no external JavaScript libraries
- Backend: Pure Python, standard Odoo ORM
- Multi-company: fully supported
- Multi-currency: fully supported
- Languages: English (base), French and Spanish translations included
Who This Module Is Designed For
This module is designed for organizations where payment term decisions have direct financial consequences: distributors, wholesalers, manufacturers, and service companies with significant B2B receivables portfolios.
It is the right fit when any of the following conditions apply: the finance team spends time manually reviewing payment terms before invoicing; external auditors require justification for payment term decisions; the company has experienced bad debt from customers who were granted terms inconsistent with their risk profile; or the sales team systematically applies favorable terms to push revenue without finance oversight.
It is not suited to micro-SME deployments where a single user manages the entire accounting process and payment terms are not a material governance concern.
Why This Module Is Different
Most payment term extensions for Odoo offer simple static segmentation: assign a term based on a customer category or a fixed credit limit. This module goes further by computing a dynamic, behavioral risk score from actual payment history, evaluating it against a configurable rule engine, and generating a complete audit trail for every decision.
The governance architecture — immutable logs, snapshot preservation, override justification, and role-based access — is designed to satisfy the requirements of internal audit committees and external financial auditors, not just to automate a data-entry task.
The approach is entirely deterministic. No scores are estimated, approximated, or influenced by configuration drift. The same customer data will always produce the same score, the same rule match, and the same payment term — on any company, on any date, by any user. This predictability is a core design requirement, not a secondary feature.
Complete Feature Reference
- Deterministic risk score (0–100) computed from late payment frequency, average days late, and open balance ratio
- Four risk classes: Low, Medium, High, Critical — with configurable thresholds
- Risk trend tracking: Improving, Stable, Deteriorating
- Sequence-based payment risk rule engine with multi-condition matching
- Automatic payment term assignment on Sales Orders and Customer Invoices
- Risk snapshot preserved on each invoice at the moment of validation
- Manual override support with mandatory written justification
- Immutable audit log for all automatic and manual payment term changes
- OWL 2 executive dashboard with live KPIs and risk distribution
- Analytical views: customers by class, risk trend, top risk, outstanding exposure, override frequency
- Scheduled batch recomputation via standard Odoo cron
- Multi-company and multi-currency support
- Role-based access: Risk User and Risk Manager groups
- Configurable feature toggles in Odoo Settings
- French and Spanish translations included
Replace Manual Payment Term Decisions with Governed Automation
The Dynamic Payment Terms Engine gives finance teams the infrastructure to enforce credit policy systematically, document every decision for audit, and monitor the customer risk portfolio in real time — within standard Odoo 18, without external tools or custom development.
Version 1.0.0 — Odoo 18 — License: OPL-1
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module