[FIX] hr_recruitment: fix mail alias issue in recruitment app

Issue:
  If owner is set to job position, the owner does not receive an email
  when creating a new applicant so we remove the owner if the alias is active.

task-3354799

closes odoo/odoo#126911

X-original-commit: 637c390d49f01ef374a3d4fe1fe14cca540a93f3
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Prakash Prajapati
2023-06-30 08:11:51 +02:00
parent 0a877ddfc7
commit fc444add27
+2
View File
@@ -225,6 +225,8 @@ class Job(models.Model):
def create(self, vals_list):
for vals in vals_list:
vals['favorite_user_ids'] = vals.get('favorite_user_ids', []) + [(4, self.env.uid)]
if vals.get('alias_name'):
vals['alias_user_id'] = False
jobs = super().create(vals_list)
utm_linkedin = self.env.ref("utm.utm_source_linkedin", raise_if_not_found=False)
if utm_linkedin: