Error monitoring for Odoo.

Odoo logs every server error. With sentry-sdk and a small addon those errors reach Fehlo with their traceback, from every database and from scheduled actions too.

As of 24 October 2026, sentry-sdk 2.73.0, Odoo 16 to 19. We tested the Python SDK with Fehlo on 19 October 2026. The path through Odoo is derived from Odoo's source code, not checked on a running instance.

How Odoo reports errors

The sentry SDK has no Odoo integration, and it doesn't need one. Odoo catches exceptions in requests itself (odoo/http.py) and logs them at ERROR with the message "Exception during request handling." and the traceback. The SDK's logging integration is on by default and turns every ERROR record into an event. Failed scheduled actions (cron) reach Fehlo the same way. Odoo logs UserError and AccessError only as warnings; they show up as breadcrumbs, not as issues of their own. That's intended: "please fill in the required field" is not a bug.

So all you need is to start the SDK early. The simplest way is a small addon of your own.

1. Install the package

Terminal
# Python 3.12 or newer
pip install sentry-sdk

# Python 3.10 or 3.11: Odoo pins urllib3 1.26.5, sentry-sdk 2.x needs 1.26.11 or newer
pip install sentry-sdk "urllib3>=1.26.11,<1.27"

On Python 3.10 and 3.11, Odoo's requirements.txt pins an old urllib3 that sentry-sdk 2.x won't accept. The second line raises it within the 1.26 series, which Odoo's requests still works with.

2. Create the addon

Create a folder fehlo_sentry in your addons path with two files. Adjust the version string to your Odoo version.

fehlo_sentry/__manifest__.py
{
    "name": "Fehlo Error Reporting",
    "version": "18.0.1.0.0",
    "summary": "Send server errors to Fehlo",
    "license": "LGPL-3",
    "depends": ["base"],
    "external_dependencies": {"python": ["sentry_sdk"]},
    "post_load": "post_load",
    "installable": True,
}
fehlo_sentry/__init__.py
import logging
import os

_logger = logging.getLogger(__name__)

DSN = "https://<key>@app.fehlo.de/<project-id>"


def post_load():
    try:
        import sentry_sdk
    except ImportError:
        _logger.warning("sentry-sdk is not installed, error reporting is off")
        return

    sentry_sdk.init(
        dsn=os.environ.get("SENTRY_DSN", DSN),
        environment=os.environ.get("SENTRY_ENVIRONMENT", "production"),
        release=os.environ.get("SENTRY_RELEASE"),
    )

The post_load hook runs as soon as Odoo loads the module, before any request. Instead of in code, you can set the DSN as the environment variable SENTRY_DSN, and release and environment as SENTRY_RELEASE and SENTRY_ENVIRONMENT.

3. Load the addon

Ideally as a server-wide module in odoo.conf. The SDK then starts with the server and captures errors from every database, also with --workers:

odoo.conf
[options]
server_wide_modules = base,web,fehlo_sentry

Alternatively, install the module in a database through Apps. The SDK then starts when Odoo loads that database's registry.

Odoo.sh: Odoo.sh installs packages from a requirements.txt at the root of your repository. Add sentry-sdk there. We found no documented way to set server_wide_modules or environment variables on Odoo.sh, so install the module in the database there and put the DSN in the module.

4. Test it

Switch on developer mode and create a server action under Settings, Technical, Actions:

Server action
# Settings > Technical > Actions > Server Actions (developer mode)
# Type "Execute Code", code:
1 / 0

Run it. Odoo shows an error dialog, and Fehlo shows an issue "Exception during request handling." with the traceback.

Alternative: the OCA module "sentry"

The Odoo Community Association maintains a sentry module for versions 16.0 to 19.0 in OCA/server-tools. It loads server-wide and is configured with keys in odoo.conf:

odoo.conf
[options]
server_wide_modules = base,web,sentry
sentry_dsn = https://<key>@app.fehlo.de/<project-id>
sentry_enabled = true
sentry_environment = production
sentry_logging_level = error
sentry_include_context = false

What to know:

  • Branches 16.0 and 17.0 require sentry-sdk up to 1.9.0 and don't run with a current 2.x SDK. 18.0 and 19.0 require 2.0 to 2.22.
  • From 19.0, the keys go in a [sentry] section instead of [options].
  • sentry_include_context is on by default and sends the user's login (in the email field), their ID, all request headers and the IP address. Set it to false if you don't need that.
  • On startup the module sends a "Starting Odoo Server" event, which doubles as your test.

If you already run OCA modules and have a version with a matching SDK, it's a fine option. Otherwise the addon above is shorter and works with the current SDK on every version.

Privacy

Without further options the Python SDK sends no IP addresses, cookies or user data. Don't set data_collection: once it is set, its more permissive defaults apply, and the SDK sends IP addresses, cookies and bodies. Fehlo also strips the sender's IP address on the server and filters email addresses, passwords and tokens from events. Local variables from the traceback are included; in Odoo they often hold records. More on GDPR-compliant error tracking.

Questions

Does this capture errors from scheduled actions?

Yes. Odoo logs failed cron jobs with their traceback at ERROR, and the SDK's logging integration turns that into an event.

Why don't I see UserError messages as issues?

Odoo logs UserError and AccessError as warnings. The SDK reports from ERROR up. The warnings appear as breadcrumbs before the next real error.

Does it work with several databases on one server?

Yes, when you load the module server-wide. All databases then report to the same Fehlo project. The SDK runs once per Odoo process, so separate projects per database need separate Odoo instances.

Nothing arrives. What should I check?

First the DSN: it has to point at app.fehlo.de. Second, whether your server or browser can reach https://app.fehlo.de (firewall, proxy, ad blocker). Third, whether this month's quota is used up; you get an email when it is. Fourth, whether sampleRate or beforeSend drops events. If only performance data is missing, this month's transactions may be used up.