Knowledge baseOdoo

Regex in reconciliation models

21 April 20263 min read

In reconciliation models you can use regex to control exactly which transactions a model applies to, and to pull amounts out of the description.

Match conditions: Match Regex

In the match conditions you can choose Contains, Does not contain or Match Regex under Label. Fill in a regular expression; Odoo then only picks up transactions that match that expression and meet the other conditions.

Counterpart items: From label

Under Amount type you can choose From label. A percentage or amount is then pulled out of the transaction's label using regex. Handy when the description follows a fixed pattern.

Examples and testing

A regex is a pattern that matches text. A few examples for the label:

PatternMeaning
^FACTUUR|^INVonly lines that start with FACTUUR or INV
\d+one or more digits in a row (e.g. a SEPA reference)
BETAAL\s+REF\s+\d+contains "BETAAL REF" followed by a number
^NL.*BETAALstarts with NL and contains BETAAL somewhere

Regex is powerful but error-prone. So test first with automatic validation switched off — that way you can check the entry before you confirm it.

For more on regex: Learn Regex (Sitepoint).

Frequently asked questions

Frequently asked questions

Where do I use regex in reconciliation models?

In the match conditions you pick Match Regex under Label and fill in an expression. Under counterpart items you pick From label as the amount type to pull an amount or percentage out of the label using regex.

How do I test a regex without creating wrong entries?

Turn off automatic validation. That way you can check the proposed entry before you confirm it. Preferably test on a copy or a staging environment.

Where can I learn more about regex syntax?

The Learn Regex course on Sitepoint explains the syntax. See the link below the examples in this article.

Answer not found?

Ask an engineer directly — we usually respond within one business day.