Files
odoo_source/odoo/addons/base/data/neutralize.sql
T
Mathieu Walravens 5593159828 [IMP] base: neutralize webhooks
The user can define automated actions for sending data to a remote
server using a webhook.
To prevent this feature from sending unwanted data from a test database,
this commit neutralizes the field `webhook_url` to an invalid URL.
When the action is run, a warning is logged.

closes odoo/odoo#149592

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-01-16 22:40:02 +00:00

29 lines
859 B
SQL

-- deactivate mail servers
UPDATE ir_mail_server
SET active = false;
-- insert dummy mail server to prevent using fallback servers specified using command line
INSERT INTO ir_mail_server(name, smtp_port, smtp_host, smtp_encryption, active, smtp_authentication)
VALUES ('neutralization - disable emails', 1025, 'invalid', 'none', true, 'login');
-- deactivate crons
UPDATE ir_cron
SET active = false
WHERE id NOT IN (
SELECT res_id
FROM ir_model_data
WHERE model = 'ir.cron'
AND name = 'autovacuum_job'
);
-- neutralization flag for the database
INSERT INTO ir_config_parameter (key, value)
VALUES ('database.is_neutralized', true)
ON CONFLICT (key) DO
UPDATE SET value = true;
-- deactivate webhooks
UPDATE ir_act_server
SET webhook_url = 'neutralization - disable webhook'
WHERE state = 'webhook';