New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] mail: templates preview wrong recipients #149563
[FIX] mail: templates preview wrong recipients #149563
Conversation
Alternative solution would be to use re.findall(r'\d+', partner_to) |
Actually partner_to should be a list of partner ids (comma separated list of ids). It is not meant to be used with records, it is not a m2m field, as help on field tells: |
The real fix is to use |
thanks so this is not an issue and there should be in step 6, eg. |
Indeed. Note that we could try to support a stringified list in addition to a comma separated list of ids for that kind of use case, aka considering |
f0310cb
to
3b753db
Compare
@tde-banana-odoo Done + modified commit message |
7ad39ab
to
a8faa9d
Compare
Hi @tde-banana-odoo |
|
a8faa9d
to
984cf88
Compare
@tde-banana-odoo I added the fallback to the previous version of the function as requested, what do you think ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zboing, looked at it again, small improvement proposal + some lint on tests :)
984cf88
to
5421a1a
Compare
Steps to reproduce: 1. Activate dev mode 2. Go to Email Templates 3. Create a new template 4. Applies to Task 5. Email Configuration > To (Partners) 6. {{[p.id for p in object.message_partner_ids]}} 7. Click on Preview 8. Select a record with followers 9. Look at Recipients 10. => No or not all followers/partners are included Cause of the issue: Caused by odoo@cf7ae6b In the case of partner_to being '[2,3,4]' Split would output '[2', '3', '4]' So after the isdigit it would be '3' It should have been 2, 3, 4 opw-3677069
5421a1a
to
01d16c6
Compare
Hi @tde-banana-odoo I updated the code with the best of both worlds, and modified the test, tell me what you think ! |
@robodoo r+ Thanks :) |
Steps to reproduce: 1. Activate dev mode 2. Go to Email Templates 3. Create a new template 4. Applies to Task 5. Email Configuration > To (Partners) 6. {{[p.id for p in object.message_partner_ids]}} 7. Click on Preview 8. Select a record with followers 9. Look at Recipients 10. => No or not all followers/partners are included Cause of the issue: Caused by cf7ae6b In the case of partner_to being '[2,3,4]' Split would output '[2', '3', '4]' So after the isdigit it would be '3' It should have been 2, 3, 4 opw-3677069 closes #149563 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
Cause of the issue:
Caused by cf7ae6b
In the case of partner_to being '[2,3,4]'
Split would output '[2', '3', '4]'
So after the isdigit it would be '3'
It should have been 2, 3, 4
opw-3677069
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr