[FIX] mail: multi recipient duplication (16.0)#186149
[FIX] mail: multi recipient duplication (16.0)#186149Julien00859 wants to merge 3 commits intoodoo:16.0from
Conversation
tde-banana-odoo
left a comment
There was a problem hiding this comment.
Thanks for retaking it and fixing it a bit in-depth ! Few comments on my side.
There was a problem hiding this comment.
Why is the second one canceled ? Is the content exactly the same ? In that case would probably update template content, as purpose here is to really test a multi send, not really duplicate check, would prefer keeping "sent" emails.
There was a problem hiding this comment.
It is sending the same template to both test_records, the second one is cancelled for mail_dup. I've tried for 2 hours to find a solution but I achieved nothing. Do you have a suggestion?
There was a problem hiding this comment.
In 16, duplication is done only on email (not on actual content like in newer versions, where we check attachments, subject, ...). You can use the mailing_document_based context key to remove the duplicate check in this case (as we are not trying to check duplicate check here, more email parsing). It was added in stable to indicate there are documents where same email does not mean duplicate (e.g. invoice, sale orders, ...).
There was a problem hiding this comment.
Why pass ? Can't we go in check below ?
There was a problem hiding this comment.
I don't know, some check in the else block were failing and I didn't understand those...
Make it work -> make it good (-> make it fast)
I made it work, would you help me make it good? :D
There was a problem hiding this comment.
What was failing :D ?
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361
28f1445 to
d8fa126
Compare
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361
d8fa126 to
0819a81
Compare
|
@robodoo r+ rebase-merge Woop woop ! |
|
Merge method set to rebase and merge, using the PR as merge commit message. |
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #186799 Forward-port-of: #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #188449 Forward-port-of: #186799 Forward-port-of: #186149 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #188426 Forward-port-of: #186799 Forward-port-of: #186149 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #188469 Forward-port-of: #186799 Forward-port-of: #186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #189071 Forward-port-of: #188469 Forward-port-of: #186149 Related: odoo/enterprise#75667 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #189071 Forward-port-of: #188469 Forward-port-of: #186149 Related: odoo/enterprise#75667 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 Part-of: odoo#186149 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>

Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one.
The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him.
In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes.
Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty.
Task-3927361