Skip to content

[FIX] mass_mailing_partner: optimize duplicates check and error message#17

Closed
yajo wants to merge 1 commit into
OCA:18.0from
moduon:18.0-mass_mailing_partner-optimize_dupes_check
Closed

[FIX] mass_mailing_partner: optimize duplicates check and error message#17
yajo wants to merge 1 commit into
OCA:18.0from
moduon:18.0-mass_mailing_partner-optimize_dupes_check

Conversation

@yajo
Copy link
Copy Markdown
Member

@yajo yajo commented Mar 23, 2026

Code is simpler, it benefits from ORM cache (which is helpful because checks are done before flushing), and the error message now tells problematic partners.

@moduon MT-13677

Code is simpler, it benefits from ORM cache (which is helpful because checks are done before flushing), and the error message now tells problematic partners.

@moduon MT-13677
@yajo yajo force-pushed the 18.0-mass_mailing_partner-optimize_dupes_check branch from 14de6ec to 73226f1 Compare March 23, 2026 13:53
Copy link
Copy Markdown
Contributor

@Shide Shide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

@pedrobaeza
Copy link
Copy Markdown
Member

Please check OCA/social#1830 that is pending to be fw-ported.

@yajo
Copy link
Copy Markdown
Member Author

yajo commented Mar 25, 2026

I find it strange that you just removed such feature... Could you elaborate a bit on why?

@pedrobaeza
Copy link
Copy Markdown
Member

Because it's a legacy check before Odoo changed the way mass mailing contacts are handled. If you check on runbot, Odoo allows to have several mailing contacts in the same list with the same email. When sending the mailing, it will be sent only once (there's an email deduplication). Artificially prevent these duplicates only complicates the user management and provokes to the user a lot of friction. Examples:

  • An email in a contact linked to a mass mailing contact is changed, and that one is the same as another.
  • You do a mass contact import into a mailing list. You will get error if several contacts of that selection have the same email.
  • etc

Thus, it's better to remove that artificial restriction. The only trade-off is that the sent mass mailings will be linked to the first contact found, but that's something reasonable.

@yajo
Copy link
Copy Markdown
Member Author

yajo commented Mar 26, 2026

Thanks for the explanation! Then, indeed that's the proper solution.

I can't believe this passed under our radar since v15: odoo/odoo#61467

@yajo yajo closed this Mar 26, 2026
@yajo yajo deleted the 18.0-mass_mailing_partner-optimize_dupes_check branch March 26, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants