[17.0]mail_composer_cc_bcc : UnboundLocalError: local variable 'res_id_to_company' referenced before assignment
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:
- Just send an email where variable 'find_or_create_partners' = False
Expected behavior Normaly, we are able to send email without error
Additional context
Hello @fgenubeo, the method was refactored in https://github.com/OCA/social/pull/1494, worth reviewing
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.