Skip to content

[19.0][IMP] subscription_oca: compute MRR and ARR#1451

Open
alvaro-domatix wants to merge 1 commit into
OCA:19.0from
alvaro-domatix:19.0-imp-subscription_oca-mrr-arr
Open

[19.0][IMP] subscription_oca: compute MRR and ARR#1451
alvaro-domatix wants to merge 1 commit into
OCA:19.0from
alvaro-domatix:19.0-imp-subscription_oca-mrr-arr

Conversation

@alvaro-domatix

Copy link
Copy Markdown

Adds MRR/ARR to subscriptions:

  • recurring_monthly on each subscription line: price_subtotal normalised to a monthly amount from the template recurrence (30.4375 days/month average for daily/weekly cadences), converted to the company currency so subscriptions in different currencies can be compared and summed.
  • recurring_monthly / recurring_yearly on the subscription: sum of the lines, ARR being 12 x MRR.

They are shown as a stat button on the form, optional sum columns on the list view and a "With recurring revenue" search filter.

Supersedes #1443.

@szalatyzuzanna szalatyzuzanna left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question regarding the scope of this feature. Since MRR/ARR are reporting-oriented KPIs rather than core subscription functionality, was a separate extension module considered instead of adding them directly to subscription_oca?

@alvaro-domatix

Copy link
Copy Markdown
Author

Thanks for raising the scope question. I considered a separate extension module, but I kept MRR/ARR in subscription_oca on purpose, for a few reasons:

  1. They are fields on the record itself, not a reporting overlay. recurring_monthly/recurring_yearly are computed fields on sale.subscription, exposed directly in the form via stat buttons alongside recurring_total. They are part of the contract's own figures, the same way recurring_total/recurring_next_date already are — both are computed on the model today. Splitting MRR out would mean an extra module for two fields that belong to the same family of native computes.

  2. No new dependency is introduced. The rating and SMS features were split into bridge modules precisely because they pull in rating.mixin / the SMS stack. MRR/ARR add none of that — it is a pure Python normalisation of the existing line subtotals (plus a currency conversion). So the usual reason to factor a feature out (to avoid forcing a heavy dependency on the core) does not apply here.

  3. Downstream depends on the field. The reporting analysis ([19.0][ADD] subscription_oca: subscription analysis reporting #1471) and the spreadsheet dashboards read recurring_monthly. Moving it to an extension would turn all of those into dependent modules and add an install step for a feature that is just two computed fields.

If anyone feels strongly that the KPI should not be forced on everyone, I can gate the display (stat buttons / list columns) behind a group or a setting rather than splitting the module — but the compute itself stays on the model. Happy to go either way; my recommendation is to keep it as is.

@alvaro-domatix alvaro-domatix force-pushed the 19.0-imp-subscription_oca-mrr-arr branch from e701e06 to 9010bd4 Compare June 25, 2026 11:25
Add two stored computed monetary fields on `sale.subscription`:

* `recurring_monthly` — sum of the subscription lines normalised to a
  monthly amount (Monthly Recurring Revenue).
* `recurring_yearly` — twelve times the monthly figure (Annual
  Recurring Revenue).

Each line also exposes its own `recurring_monthly`, derived from
`price_subtotal` and the template recurrence. A line that bills every
N `days`, `weeks`, `months` or `years` is converted to months using
30.4375 average days per month for sub-monthly cadences and a direct
multiplier otherwise, then divided by the `recurring_interval`.

This makes subscriptions of different cadences directly comparable and
sum-able, so reports can answer the basic "how much do I bill per
month?" question without external spreadsheets.

The fields are visible as a new MRR/ARR stat button on the
subscription form, as optional columns with sum aggregation on the
list view, and as a "With recurring revenue" filter on the search
view.

Migration: pure ORM recompute on `-u subscription_oca`. Expect roughly
two seconds per ten thousand subscription lines.
@alvaro-domatix alvaro-domatix force-pushed the 19.0-imp-subscription_oca-mrr-arr branch from 9010bd4 to fe91224 Compare June 25, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants