[IMP] (website_)hr_recruitment : Improve UX

In this PR we'll add the following UX improvements :
- Drop the useless responsible_id field from hr_job
- Include applicant attachments in the meeting when scheduling an interview
- Several tooltip and default value changes
task-3380150

closes odoo/odoo#125932

Related: odoo/upgrade#4808
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
This commit is contained in:
Jurgen (jugj)
2023-10-06 08:25:19 +00:00
committed by jugj-odoo
parent 56073896a6
commit fb320856c0
9 changed files with 38 additions and 16 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ class Job(models.Model):
no_of_hired_employee = fields.Integer(string='Hired Employees', copy=False,
help='Number of hired employees for this job position during recruitment phase.')
employee_ids = fields.One2many('hr.employee', 'job_id', string='Employees', groups='base.group_user')
description = fields.Html(string='Job Description', sanitize_attributes=False)
description = fields.Html(string='Job Description', sanitize_attributes=False,
default="Perform assigned responsibilities, collaborate with team members, and adhere to company policies. Strong communication, problem-solving, and work ethic required. Adaptability, initiative, and willingness to learn are valued.")
requirements = fields.Text('Requirements')
department_id = fields.Many2one('hr.department', string='Department', check_company=True)
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company)
+21
View File
@@ -2,12 +2,33 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.exceptions import AccessError
class CalendarEvent(models.Model):
""" Model for Calendar Event """
_inherit = 'calendar.event'
@api.model_create_multi
def create(self, vals_list):
events = super(CalendarEvent, self).create(vals_list)
try:
self.env['hr.applicant'].check_access_rights('read')
except AccessError:
return events
if "default_applicant_id" in self.env.context:
applicant_attachments = self.env['hr.applicant'].browse(self.env.context['default_applicant_id']).attachment_ids
for event in events:
self.env['ir.attachment'].create([{
'name': att.name,
'type': 'binary',
'datas': att.datas,
'res_model': event._name,
'res_id': event.id
} for att in applicant_attachments])
return events
@api.model
def default_get(self, fields):
if self.env.context.get('default_applicant_id'):
@@ -440,6 +440,7 @@ class Applicant(models.Model):
'default_user_id': self.env.uid,
'default_name': self.name,
'default_categ_ids': category and [category.id] or False,
'attachment_ids': self.attachment_ids.ids
}
return res
+1 -4
View File
@@ -30,7 +30,7 @@ class Job(models.Model):
address_id = fields.Many2one(
'res.partner', "Job Location", default=_default_address_id,
domain=lambda self: self._address_id_domain(),
help="Address where employees are working")
help="Select the location where the applicant will work. Addresses listed here are defined on the company's contact information.")
application_ids = fields.One2many('hr.applicant', 'job_id', "Job Applications")
application_count = fields.Integer(compute='_compute_application_count', string="Application Count")
all_application_count = fields.Integer(compute='_compute_all_application_count', string="All Application Count")
@@ -44,9 +44,6 @@ class Job(models.Model):
'hr.employee', related='department_id.manager_id', string="Department Manager",
readonly=True, store=True)
user_id = fields.Many2one('res.users', "Recruiter", domain="[('share', '=', False), ('company_ids', 'in', company_id)]", tracking=True, help="The Recruiter will be the default value for all Applicants Recruiter's field in this job position. The Recruiter is automatically added to all meetings with the Applicant.")
hr_responsible_id = fields.Many2one(
'res.users', "HR Responsible", tracking=True,
help="Person responsible of validating the employee's contracts.")
document_ids = fields.One2many('ir.attachment', compute='_compute_document_ids', string="Documents", readonly=True)
documents_count = fields.Integer(compute='_compute_document_ids', string="Document Count")
alias_id = fields.Many2one(help="Email alias for this job position. New emails will automatically create new applicants for this job position.")
@@ -229,10 +229,15 @@
<field name="stage_id" domain="[]"/>
<field name="categ_ids"/>
<field name="refuse_reason_id"/>
<field name="application_status"/>
<field name="date_closed"/>
<field name="attachment_ids" filter_domain="[('attachment_ids.index_content', 'ilike', self)]" string="Resume's content"/>
<filter string="My Applications" name="my_applications" domain="[('user_id', '=', uid)]"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id', '=', False)]"/>
<separator/>
<filter string="In Progress" name="ongoing" domain="[('date_closed', '=', False), ('active', '=', True), ('refuse_reason_id', '=', False)]"/>
<filter string="Hired" name="hired" domain="[('date_closed', '!=', False)]"/>
<separator/>
<filter string="Ready for Next Stage" name="done" domain="[('kanban_state', '=', 'done')]"/>
<filter string="Blocked" name="blocked" domain="[('kanban_state', '=', 'blocked')]"/>
<filter string="Reserve" name="reserve" domain="[('job_id', '=', False)]"/>
@@ -263,10 +268,10 @@
<filter string="Stage" name="stage" domain="[]" context="{'group_by': 'stage_id'}"/>
<filter string="Responsible" name="responsible" domain="[]" context="{'group_by': 'user_id'}"/>
<filter string="Creation Date" name="creation_date" context="{'group_by': 'create_date'}"/>
<filter string="Hiring Date" name="hired_date" context="{'group_by': 'date_closed'}"/>
<filter string="Last Stage Update" name="last_stage_update" context="{'group_by': 'date_last_stage_update'}"/>
<filter string="Refuse Reason" name="refuse_reason_id" domain="[]" context="{'group_by': 'refuse_reason_id'}"/>
<filter string="Degree" name="degree" domain="[]" context="{'group_by': 'type_id'}"/>
<filter string="Tags" name="group_by_categ_ids" context="{'group_by':'categ_ids'}"/>
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
@@ -35,9 +35,6 @@
<xpath expr="//field[@name='email_from']" position="after">
<field name="applicant_skill_ids"/>
</xpath>
<filter name="refuse_reason_id" position="after">
<filter string="Skills" name="groupby_skills" context="{'group_by': 'skill_ids'}"/>
</filter>
</field>
</record>
@@ -29,7 +29,7 @@ class Job(models.Model):
default=_get_default_description, prefetch=False,
sanitize_overridable=True,
sanitize_attributes=False, sanitize_form=False)
website_published = fields.Boolean(help='Set if the application is published on the website of the company.')
website_published = fields.Boolean(help='Set if the application is published on the website of the company.', tracking=True)
website_description = fields.Html(
'Website description', translate=html_translate,
default=_get_default_website_description, prefetch=False,
@@ -32,8 +32,8 @@
<field name="inherit_id" ref="hr.view_hr_job_form"/>
<field name="arch" type="xml">
<page name="recruitment_page" position="inside">
<label for="job_details" class="mb-2"/>
<field name="job_details"/>
<separator string="Process Details"/>
<field name="job_details" nolabel="1"/>
</page>
</field>
</record>
@@ -353,9 +353,9 @@
<!-- Job Default Description -->
<template id="default_description" name="Job Description">
<p>
You can customize this sample job description with a short overview of
the job position, defining specific terms and benefits. Keep it simple
an clear.
Perform assigned responsibilities, collaborate with team members, and adhere to company policies.
Strong communication, problem-solving, and work ethic required.
Adaptability, initiative, and willingness to learn are valued.
</p>
</template>