Steps to reproduce:
- Install Recruitment module
- Set a valid outgoing mail server and archive it
- Go to Recruitment > Applications > All Applications
- Create a new application
- Set a Subject and email, then save
- Click on button 'Refuse'
- Select any reason (ensure "send email" is checked)
Issue:
The email is sent to the applicant through the archived email server.
Cause:
The current action have 'active_test' set to 'False' in the context
(useful when archiving an applicant though action menu, since it
trigger action 'action_refuse_reason_apply' and current applicant
will be archived at that point).
Therefore, the archived email server will be used (in case it's the
only one, or if it has more priority than any other one).
Solution:
Set 'active_test' to 'True' in the context when sending mail.
opw-2845545
closesodoo/odoo#91161
X-original-commit: c4f6bd121d242dca6eefa697dba23fd6f055bbe0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>