Skip to content

[18.0][ADD] base_import_mail_disable: disable outgoing mail during imports#3582

Open
BhaveshHeliconia wants to merge 1 commit intoOCA:18.0from
HeliconiaIO:18.0-add-base_import_mail_disable
Open

[18.0][ADD] base_import_mail_disable: disable outgoing mail during imports#3582
BhaveshHeliconia wants to merge 1 commit intoOCA:18.0from
HeliconiaIO:18.0-add-base_import_mail_disable

Conversation

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor

Goal

Introduce the base_import_mail_disable module to ensure that Odoo strictly disables outbound emails when importing massive quantities of data via the standard base_import wizard.

Motivation

Natively, some third-party extensions or aggressive models may bypass Odoo's core tracking parameters and explicitly try to build outbound emails whenever a record is created during an import. This can lead to SMTP server flooding and unwanted notifications being sent to users.

Functionality

This module provides absolute global SMTP silence by leveraging an impenetrable Outbox shield:

  1. Mail Intercept Barrier: Force-overrides mail.mail globally to catch any outgoing mail transactions occurring while the native import_file=True context is active.
  2. State Override: Intercepts the queue and gracefully marks outbound transmissions as "Cancelled".
  3. Synchronous Bypass: Intercepts synchronous mail.mail.send() calls during imports to prevent immediate dispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant