Menu

Stop Before Testing: Understanding Odoo's Neutralized Database and the neutralize.sql File

A complete guide to Odoo's neutralized database mechanism and how to define your own neutralize.sql file for custom modules
Test database — Neutralized mode active. No critical action can be triggered on this environment. You can work safely.

Every Odoo professional knows the anxiety: "What if this test action hits production?" One wrong click, and you send an email to real customers, synchronize real banking data, or validate a payment that should have remained fictitious.

This is precisely why Odoo includes an elegant and often overlooked mechanism: the neutralized database. Understanding how it works means gaining peace of mind and professionalism on every project.

What is a Neutralized Database?

A neutralized database is simply a protected copy of your production database. As soon as Odoo detects that a database is not intended for real operations — backup restoration, duplication, staging environment — it automatically switches to a safe mode.

The most visible sign: a red banner appears at the top of the interface. This banner is your signal that nothing critical can reach production. In short: you work with real data, but without real consequences.

When Does a Database Become Neutralized?

Odoo triggers neutralization automatically in four very common situations:

01
Restoring a production backup for testing
02
Duplicating the main database (training, experimentation)
03
Staging and dev branches on Odoo.sh — neutralized by default
04
Version migration tests (e.g. Odoo 16 to 17)

What Gets Deactivated

To protect your business, Odoo disables seven categories of critical features:

Outgoing emails
No message can be sent to your real customers, suppliers or external users.
Scheduled actions
Automatic processes (mass invoicing, reminders, subscriptions) do not execute.
Bank synchronization
Live banking feeds are disconnected to prevent any financial anomaly.
Payment providers
Stripe, PayPal and other real gateways are disabled — no accidental charges possible.
Delivery methods
Carrier integrations are cut off — no real shipment can be triggered.
IAP credits
In-App Purchases are locked to prevent accidental consumption of paid services.
Website visibility
Test websites are hidden from search engines — no risk of duplicate content or SEO damage.

What This Changes in Your Projects

Seeing the red banner means having the freedom to work without fear. Neutralization is not a constraint — it is a professional safety net that allows you to act with confidence.

You can safely
· Test new workflows
· Reproduce and fix bugs
· Train your users
· Test automation rules
· Prepare major upgrades
Without risking
· Client communications
· Financial data integrity
· Ongoing operations
· Your company's reputation
· Unwanted fees or payments
In Summary

Odoo's neutralized database is not just a technical feature — it is a professional safety mechanism. Whenever you see that red banner, know that you are in a safe space to test, learn and experiment.

Understanding this system means working on Odoo with the confidence of experts. Because in a production ERP, trust is not improvised — it is built with the right tools.


Technical Section

Defining Your Own neutralize.sql File

Odoo allows you to extend neutralization to your own modules by creating a neutralize.sql file. It is executed automatically during each database neutralization, after Odoo's native file.

Good to know: No declaration in __manifest__.py is required. Odoo automatically detects the file if placed in data/neutralize.sql at the root of your module.

File Location in the Module

tree structure
my_module/
├── __init__.py
├── __manifest__.py
├── models/
├── views/
└── data/
    └── neutralize.sql   ← here

Practical Example

Here is the most common case: a module integrating an external API with a secret key and a production endpoint. On a neutralized database, these values must never remain active.

data/neutralize.sql SQL · PostgreSQL
-- Mask external API credentials
UPDATE my_module_config
   SET api_key    = 'NEUTRALIZED',
       api_secret = 'NEUTRALIZED',
       endpoint   = 'https://sandbox.example.com';

Three fields, three lines. The key and secret are replaced with an inert value, and the endpoint switches to the provider's sandbox. No production data can leak to an external service.

Important: This file should only contain UPDATE and SET statements. Avoid any DELETE or ALTER TABLE — it is designed to neutralize values, not to modify the database structure.
Best Practice: Version This File

Like any file in your module, neutralize.sql should live in your Git repository. Update it every time you add an external integration or a table containing sensitive data.

On Odoo.sh, it is executed automatically each time a staging branch is created from production — a reliable and reproducible safety net on every deployment.

Odoo neutralized database, Odoo neutralize.sql, Odoo test database safety, Odoo staging environment, Odoo.sh neutralization, Odoo database protection, Odoo red banner test mode, Odoo backup restore neutralize, Odoo custom neutralize SQL, Odoo disable emails test database, Odoo deactivate payment providers test, Odoo scheduled actions disabled, base de données neutralisée Odoo, neutralize.sql Odoo, Odoo base de test
Share this post
Odoo: the magic solution to transform your business
Discover how Odoo can centralize and automate all your processes like magic