Skip to Content
Menu
This question has been flagged
2 Replies
913 Zobrazenia

Hello,

Is it possible to send emails while the database is in a neutralized mode for testing purposes (staging)? I'm working on a migration and need a solution for this phase. I’ve already activated the outgoing mail server, and it works in production, but I’m looking for a way to make it functional in this testing context. Has anyone encountered this issue or found an effective workaround?

Thank you in advance!

Avatar
Zrušiť
Best Answer

Hi,


Yes, it's possible to test emails in a neutralized Odoo database safely.


If you want to prevent emails from going to real contacts but still test the flow, you can overwrite all res_partner emails (excluding internal users) using this SQL query via psql:


UPDATE res_partner

SET email = 'test.yourname@example.com'

WHERE email IS NOT NULL

  AND id NOT IN (

    SELECT partner_id FROM res_users WHERE partner_id IS NOT NULL

  );


This updates only external contacts, leaving internal user-linked partners untouched.


Hope it helps.

Avatar
Zrušiť