Inactive customers
Which customers stopped buying more than N days ago, and how much had they bought?
Verified Metric version 1.2.0
What it is
Customers with at least one purchase in the history (by default the last 2 years) and none in the last N days (90 by default). For each one: the date of the last purchase, how many days ago, the number of purchases and the net amount bought in the history. The headline number is the sum of that amount: what is at risk.
What it is not
- It does not include those who never bought: that is prospecting, not an inactive customer.
- It does not count a return as a purchase: it does not renew the last purchase date.
- It does not include till sales without an identified customer: there is no one to call.
- It is not a salesperson's whole portfolio: the salesperson filter is the one on the customer record.
Pitfalls this metric handles
The traps a hasty calculation falls into — and how this metric avoids each one.
Return as a purchase
- The mistake
- Using the date of the customer's last document, returns included.
- Why it happens
- A customer who only returned looks active.
- How we handle it
- The last purchase is the last sale; a return only takes value away.
Order as a purchase
- The mistake
- Using the date of the last confirmed order.
- Why it happens
- A cancelled order or one without an invoice renews the customer without a sale.
- How we handle it
- Only the sale (invoice or till) counts.
Point-of-sale order with an invoice
- The mistake
- Counting the till order and its invoice as two purchases.
- Why it happens
- It doubles the number of purchases and the historical amount.
- How we handle it
- The net sales rule: an order with an invoice counts through the invoice.
Time zone
- The mistake
- Reading the till date in UTC.
- Why it happens
- An evening purchase falls on the next day and changes the day count.
- How we handle it
- Convert to Brasília time (UTC−3).
Where the number comes from
Audit trail
- Odoo model
account.move + pos.order + res.partner- Fields
account.move.partner_id,account.move.invoice_date,pos.order.partner_id,pos.order.date_order,res.partner.user_id- Why this path
- The purchase date is that of the document that counts the sale (the same as net sales). The portfolio salesperson comes from the customer record.
How you can adjust it
| Parameter | What it does | Options |
|---|---|---|
| Companies | company ids, always explicit | — |
| Window in days | no purchase for more than N days | — |
| Period | the history read {from, to}; without a period, the last 2 years | — |
| Filters | narrow down by portfolio salespeople or customers (lists of ids) | salespeople and customers |
| Group by | the table row: customer, or the total per portfolio salesperson | customer and salesperson |
| Sort by | order of the customers | amount, last purchase, and name |
| Items listed | how many customers to list; the total always covers the whole set | — |
Validation
To be validated on a real database. The method comes from a script that already ran in a customer's operation, and the calculation passes the automated tests against the demo database. IntData has not yet checked it on a real database; until then, check the first result in Odoo using the path in the audit trail.
- Date
- October 25, 2026
- Checked against
- The demo database, customer by customer against the sales documents, and the test Odoo servers. To be validated on a real database.
- Expected Odoo versions
14.0,16.0,17.0,18.0,19.0,20.0- Note
- Without point of sale, invoices only. Does not use read_group.
Need a variation of this metric, or another one that does not exist yet?