[FIX] hr_recruitment: Keep phone number with mail template

Before this commit:
If a template_id is put on the first stage, a partner is
automatically created at the creation of the applicant. And if the
applicant had a phone or a mobile, they are removed.

After this commit:
The phone and mobile are saved on partner and not removed from
applicant.

taskId 2299970

closes odoo/odoo#54574

X-original-commit: 3735c3363f422d01ae1ff96e761a1b206fc32a69
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
This commit is contained in:
jbm-odoo
2020-07-16 12:18:21 +00:00
parent 18360d80cf
commit a8a77588be
@@ -421,7 +421,11 @@ class Applicant(models.Model):
new_partner = message.partner_ids.filtered(lambda partner: partner.email == self.email_from)
if new_partner:
if new_partner.create_date.date() == fields.Date.today():
new_partner.type = 'private'
new_partner.write({
'type': 'private',
'phone': self.partner_phone,
'mobile': self.partner_mobile,
})
self.search([
('partner_id', '=', False),
('email_from', '=', new_partner.email),