Version: ODOO 10
App: Applicants (hr.applicant)
Today over 1000 of our users received an empty e-mail, (probably) relating to an automated action. This was not supposed to happen. I can't figure out why the e-mails were sent (over 5000 failed to send - fortunately) so I'm detailing the case here in the hope of someone having an answer.
I set up the automated time-based action with this flow in mind:
Phase of applicant is changed to 'Not interesting'
Applicant receives an e-mail with the reason why he's in 'Not interesting'
The automated action is set up like this:
Filtered on all applicants in the phase called 'Not interesting' (51 applicants)
Trigger after change in phase: time delay 5 min (I chose this trigger instead of 'edit' because in our flow the applicant's data can be edited which would trigger a new email every time)
The called server action is 'Send email'
The email template, linked to in the server action, contains the name of the applicant ${object.partner_id.name} and the name of the responsible to that applicant ${object.user_id.name}.
E-mail settings:
From ${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}
To (E-mails) ${object.partner_id.email}
In my test instance, it does exactly that: send the e-mail to the applicant when he's moved to the phase 'Not interesting' (5min. after change in phase).
In my production instance, as detailed above, something went wrong. I have noticed 2 major differences in the sent emails, comparing to what was expected to happen:
ODOO sent the email to users outside of the filtered phase 'Not ok'. The filter was not taken into account
The translations for the sent email were not loaded. This means that all users received an empty email since I only changed the translation for the template (keeping that in mind for new templates ..)
Any idea what went wrong here? And most importantly, how I avoid this in the future?
Hi,
Can you paste the function called in your automated action so that we can check ?