Skip to content
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

[17.0]mail_composer_cc_bcc : UnboundLocalError: local variable 'res_id_to_company' referenced before assignment #1596

Open
fgenubeo opened this issue Feb 14, 2025 · 0 comments
Labels

Comments

@fgenubeo
Copy link

Module

mail_composer_cc_bcc

Describe the bug

The method '_generate_template_recipients' in model 'mail.template' (models/mail_template.py) set a local variable res_id_to_company at the wrong position. Because it assign them in a if and we use it in other block of code.
So it raise this error :
File "/mnt/OCA-social/mail_composer_cc_bcc/models/mail_template.py", line 126, in _generate_template_recipients
record_company = res_id_to_company.get(res_id)
UnboundLocalError: local variable 'res_id_to_company' referenced before assignment

To Reproduce

17.0:

Steps to reproduce the behavior:

  1. Just send an email where variable 'find_or_create_partners' = False

Expected behavior
Normaly, we are able to send email without error

Additional context

@fgenubeo fgenubeo added the bug label Feb 14, 2025
@fgenubeo fgenubeo changed the title UnboundLocalError: local variable 'res_id_to_company' referenced before assignment [17.0]mail_composer_cc_bcc : UnboundLocalError: local variable 'res_id_to_company' referenced before assignment Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant