[FIX] mass_mailing: fix finding duplicate mails
Before the commit, the _get_seen_list() function in the mass_mailing module was not able to correctly identify all the duplicate email addresses in a given mass mailing. This was because the function chose and used only one way to find an email address for each record in the mailing list, even though there are many ways to find an email address for a record. For example, a crm.lead record might have an email address in its partner_id field, but it might also have an email address in its email_normalized field. This can vary from record to record. To fix this issue, the _get_seen_list() function was updated to only look at the email address to which emails have already been sent, rather than trying to fetch it from the record itself. This ensures that all duplicate emails are correctly identified and that no duplicate emails are sent in the mass mailing. Task-3234378 closes odoo/odoo#134867 X-original-commit: dc0ccc19 Signed-off-by:Thibault Delavallee (tde) <tde@openerp.com>
Showing
- addons/mass_mailing/models/mailing.py 3 additions, 28 deletionsaddons/mass_mailing/models/mailing.py
- addons/test_mass_mailing/models/mailing_models.py 10 additions, 0 deletionsaddons/test_mass_mailing/models/mailing_models.py
- addons/test_mass_mailing/security/ir.model.access.csv 2 additions, 0 deletionsaddons/test_mass_mailing/security/ir.model.access.csv
- addons/test_mass_mailing/tests/test_mailing.py 31 additions, 0 deletionsaddons/test_mass_mailing/tests/test_mailing.py
Loading