diff --git a/addons/hr_recruitment/data/hr_recruitment_data.xml b/addons/hr_recruitment/data/hr_recruitment_data.xml index 2428628ab79..0059e324493 100644 --- a/addons/hr_recruitment/data/hr_recruitment_data.xml +++ b/addons/hr_recruitment/data/hr_recruitment_data.xml @@ -116,7 +116,7 @@

What is the next step?

- We usually answer applications within 3 days. + We usually answer applications within a few days.

The next step is either a call or a meeting in our offices.
@@ -156,12 +156,6 @@ % set location = '%s, %s' % (location, object.job_id.address_id.country_id.name) % endif
- - % if object.job_id.address_id: - - - - % endif @@ -214,7 +208,7 @@ % endif

What is the next step?

- We usually answer applications within 3 days.

+ We usually answer applications within a few days.

Feel free to contact us if you want a faster feedback or if you don't get news from us quickly enough (just reply to this email). @@ -250,11 +244,6 @@ % set location = '%s, %s' % (location, object.job_id.address_id.country_id.name) % endif
- % if object.job_id.address_id: - - - - % endif @@ -362,7 +351,6 @@ First Interview - 2 diff --git a/addons/hr_recruitment/data/hr_recruitment_demo.xml b/addons/hr_recruitment/data/hr_recruitment_demo.xml index 193cfe6b3f4..1bd63aa1f2b 100644 --- a/addons/hr_recruitment/data/hr_recruitment_demo.xml +++ b/addons/hr_recruitment/data/hr_recruitment_demo.xml @@ -40,6 +40,41 @@ 6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sales Manager diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index 5b7efdc78c8..aefd550d694 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -108,7 +108,15 @@ class Job(models.Model): @api.model def create(self, vals): vals['favorite_user_ids'] = vals.get('favorite_user_ids', []) + [(4, self.env.uid)] - return super(Job, self).create(vals) + new_job = super(Job, self).create(vals) + utm_linkedin = self.env.ref("utm.utm_source_linkedin", raise_if_not_found=False) + if utm_linkedin: + source_vals = { + 'source_id': utm_linkedin.id, + 'job_id': new_job.id, + } + self.env['hr.recruitment.source'].create(source_vals) + return new_job def _creation_subtype(self): return self.env.ref('hr_recruitment.mt_job_new') diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index a17e1a5e957..3623eaebd2c 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -22,7 +22,7 @@ class RecruitmentSource(models.Model): source_id = fields.Many2one('utm.source', "Source", ondelete='cascade', required=True) email = fields.Char(related='alias_id.display_name', string="Email", readonly=True) - job_id = fields.Many2one('hr.job', "Job ID") + job_id = fields.Many2one('hr.job', "Job", ondelete='cascade') alias_id = fields.Many2one('mail.alias', "Alias ID") def create_alias(self): @@ -44,7 +44,6 @@ class RecruitmentSource(models.Model): source.alias_id = self.env['mail.alias'].create(vals) source.name = source.source_id.name - class RecruitmentStage(models.Model): _name = "hr.recruitment.stage" _description = "Recruitment Stages" @@ -97,7 +96,7 @@ class Applicant(models.Model): _order = "priority desc, id desc" _inherit = ['mail.thread.cc', 'mail.activity.mixin', 'utm.mixin'] - name = fields.Char("Subject / Application Name", required=True) + name = fields.Char("Subject / Application Name", required=True, help="Email subject for applications sent via email") active = fields.Boolean("Active", default=True, help="If the active field is set to false, it will allow you to hide the case without removing it.") description = fields.Text("Description") email_from = fields.Char("Email", size=128, help="Applicant email", compute='_compute_partner_phone_email', diff --git a/addons/hr_recruitment/views/hr_job_views.xml b/addons/hr_recruitment/views/hr_job_views.xml index 462df73223c..9f874cf8eab 100644 --- a/addons/hr_recruitment/views/hr_job_views.xml +++ b/addons/hr_recruitment/views/hr_job_views.xml @@ -69,7 +69,7 @@ @@ -102,12 +102,6 @@ - - - - - - diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index b4fc4ad76b2..3062ace075b 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -27,21 +27,23 @@ - + - - + + - - - + + + + + - + - + @@ -201,7 +203,7 @@ - + hr.recruitment.source - + +