diff options
| author | Thibault Francois <tfr@openerp.com> | 2020-06-19 12:45:31 +0000 |
|---|---|---|
| committer | Thibault Francois <tfr@openerp.com> | 2020-06-22 17:15:24 +0000 |
| commit | 3ad85b6f06d4924d08bcfaf55b3694eaf8fbc7f1 (patch) | |
| tree | dfa786477819516947168b473dbd031acb9ed493 /addons | |
| parent | 61a3a4d52d70580435ad48245d3739d7aa7852fe (diff) | |
[FIX] website_hr_recruitement: Mail not send at creation
When an applicant is created from the website
and the job_id has a first stage with a template to send
the mail is actually not sent.
This is happening because at the creation of
a mail.thread values from computed field don't
appear in the change to track.
so _message_track_post_template don't see the
change on stage_id and thus don't send the email
This is going to be fix on the master
in the meanwhile we can force the value of the stage_id
at the creation of the applicant from the website form
closes odoo/odoo#53462
X-original-commit: bbaf4913382809da0c4d644f914cb3e8191a5d1b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_hr_recruitment/models/hr_recruitment.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website_hr_recruitment/models/hr_recruitment.py b/addons/website_hr_recruitment/models/hr_recruitment.py index b4a1e6acbc2..bcd8fc5a874 100644 --- a/addons/website_hr_recruitment/models/hr_recruitment.py +++ b/addons/website_hr_recruitment/models/hr_recruitment.py @@ -32,6 +32,13 @@ class Applicant(models.Model): def website_form_input_filter(self, request, values): if 'partner_name' in values: values.setdefault('name', '%s\'s Application' % values['partner_name']) + if values.get('job_id'): + stage = self.env['hr.recruitment.stage'].sudo().search([ + ('fold', '=', False), + '|', ('job_ids', '=', False), ('job_ids', '=', values['job_id']), + ], order='sequence asc', limit=1) + if stage: + values['stage_id'] = stage.id return values |
