Odoo 19 app

Database Anonymizer

Before you hand a database copy to a developer, a partner or a test team, replace the personal data in it. Database Anonymizer swaps names, e-mails, phones, addresses, bank accounts, tax IDs, messages and files for realistic fake values, by rules you control, and refuses to run unless the database is flagged as a copy.

Database Anonymizer for Odoo 19

What it does

One rule per model with a record filter; one line per field with the method to use.

Fake name, first and last name, company, e-mail, phone, street, city, ZIP, IBAN, VAT, website, text, date shift, fixed value, list, mask, hash, clear, keep.

The same real value gets the same fake value in every table of a run, so look-ups still line up.

Ready rules for contacts, users, bank accounts, messages, tracking values, outgoing e-mail, CRM leads and employees.

Who it is for

  • Companies handing a database copy to a partner or freelancer. Before the copy leaves your hands, rules swap names, e-mails, phones, streets, IBANs, VAT numbers, message bodies and lead details for fake values. The original values stay only in your live database.
  • Teams that refresh test and training databases from production. Within one run, a real value turned into a fake one always comes out the same for that method, in every table. A customer's e-mail on the contact and on its messages still match after the run.
  • Administrators worried about running it on production. Anonymization is off by default and only runs on a database flagged as a copy. The flag stores that database's UUID, so a database duplicated from it later is not flagged until someone ticks the box there too.
  • Anyone who shares a database with logins in it. The run can give every user one new password, delete their API keys and remove two-factor secrets. The superuser, the admin user, the public user and the person running it are left alone.

Setting it up

  1. Make a copy of your database with the database manager or your hosting tools, and log in to the copy.
  2. In the copy, open Settings > Database Anonymizer, tick Enable Database Anonymization and This Database Is A Copy, and check whether the Neutralized box is set.
  3. Open Anonymizer > Rules. The standard rules for contacts, users, bank accounts, messages, tracking values, outgoing e-mail, CRM leads and employees load for the apps you have; press Load Standard Rules to add any that are missing.
  4. For your own models, create a rule, set a record filter if needed, press Add All Text And Date Fields and pick a method for each line.
  5. Create a run under Anonymizer > Runs, choose the rules and the options for users, attachments and outgoing e-mail, then press Preview (Dry Run).
  6. Press Run Anonymization, type the database name and the new user password, tick I understand this cannot be undone, and press Anonymize Now.
  7. Read the Anonymization Log tab for the values changed per model and field, who ran it and how long it took.

Database Anonymizer: questions

Which methods can a field use?

Keep, clear, fixed value, random value from a list, mask, one-way hash, fake person, first or last name, company, e-mail, phone, street, city, ZIP, IBAN, VAT, lorem ipsum text, website, and a random date shift of up to 180 days by default.

Which fields can it change?

Stored char, text, html, selection, date and datetime fields. Company-dependent fields, passwords, the active flag and Odoo's own columns such as create_date are refused, and a required field cannot be cleared.

What happens if the run fails halfway?

The changes are made inside one savepoint. On any error everything is rolled back, the run is marked Failed and the error is shown on it.

Can I run it from the command line?

Yes. In odoo-bin shell, call env['mdv.anonymizer.run'].cli_run(env.cr.dbname, new_password='...') and commit. The same checks apply: enabled, flagged as a copy, and the database name given.

Does it delete files?

Only for the models you list in Delete Attachments Of. Tick Also Delete Images / Binary Fields to remove the stored images of those models as well. The outgoing e-mail queue can be emptied too.

Who can use it, and on which edition?

System administrators only, on Odoo 19 Community or Enterprise. It depends on base_setup and mail.