diff --git a/addons/hr/views/hr_job_views.xml b/addons/hr/views/hr_job_views.xml index 2b0a946fdbd..c6ac0c1a3d5 100644 --- a/addons/hr/views/hr_job_views.xml +++ b/addons/hr/views/hr_job_views.xml @@ -20,15 +20,15 @@ - + diff --git a/addons/hr_recruitment/i18n/hr_recruitment.pot b/addons/hr_recruitment/i18n/hr_recruitment.pot index ddce530b47e..69dc9ed906f 100644 --- a/addons/hr_recruitment/i18n/hr_recruitment.pot +++ b/addons/hr_recruitment/i18n/hr_recruitment.pot @@ -658,11 +658,6 @@ msgstr "" msgid "Applied Job" msgstr "" -#. module: hr_recruitment -#: model:ir.model.fields,field_description:hr_recruitment.field_hr_applicant__priority -msgid "Appreciation" -msgstr "" - #. module: hr_recruitment #: model_terms:ir.ui.view,arch_db:hr_recruitment.view_hr_job_kanban msgid "Archive" @@ -1173,6 +1168,12 @@ msgstr "" msgid "Employment Types" msgstr "" +#. module: hr_recruitment +#: model:ir.model.fields,field_description:hr_recruitment.field_hr_applicant__priority +msgid "Evaluation" +msgstr "" + + #. module: hr_recruitment #: model:ir.model.fields.selection,name:hr_recruitment.selection__hr_applicant__priority__3 msgid "Excellent" @@ -1853,6 +1854,14 @@ msgstr "" #. odoo-python #: code:addons/hr_recruitment/models/hr_applicant.py:0 #, python-format +msgid "No application found. Let's create one !" +msgstr "" + + +#. module: hr_recruitment +#. odoo-python +#: code:addons/hr_recruitment/models/hr_recruitment.py:0 +#, python-format msgid "No application yet" msgstr "" @@ -1993,6 +2002,14 @@ msgid "" "(parent_model) and task (model))" msgstr "" +#. module: hr_recruitment +#. odoo-python +#: code:addons/hr_recruitment/models/hr_recruitment.py:0 +#, python-format +msgid "People can also apply by email to save time." +msgstr "" + + #. module: hr_recruitment #: model:ir.model.fields,help:hr_recruitment.field_hr_job__hr_responsible_id msgid "Person responsible of validating the employee's contracts." @@ -2735,6 +2752,14 @@ msgid "" " of the default labels." msgstr "" +#. module: hr_recruitment +#. odoo-python +#: code:addons/hr_recruitment/models/hr_recruitment.py:0 +#, python-format +msgid "" +"You can search into attachment's content, like resumes, with the searchbar." +msgstr "" + #. module: hr_recruitment #. odoo-python #: code:addons/hr_recruitment/models/utm_source.py:0 @@ -2752,6 +2777,12 @@ msgstr "" msgid "Your Job Application: {{ object.job_id.name }}" msgstr "" +#. module: hr_recruitment +#: model_terms:ir.ui.view,arch_db:hr_recruitment.hr_applicant_view_form +#: model_terms:ir.ui.view,arch_db:hr_recruitment.quick_create_applicant_form +msgid "e.g. John Doe" +msgstr "" + #. module: hr_recruitment #: model_terms:ir.ui.view,arch_db:hr_recruitment.hr_recruitment_source_tree msgid "e.g. LinkedIn" diff --git a/addons/hr_recruitment/models/calendar.py b/addons/hr_recruitment/models/calendar.py index bb14a5e152a..3ee51623081 100644 --- a/addons/hr_recruitment/models/calendar.py +++ b/addons/hr_recruitment/models/calendar.py @@ -14,7 +14,9 @@ class CalendarEvent(models.Model): self = self.with_context( default_res_model='hr.applicant', #res_model seems to be lost without this default_res_model_id=self.env.ref('hr_recruitment.model_hr_applicant').id, - default_res_id=self.env.context['default_applicant_id'] + default_res_id=self.env.context['default_applicant_id'], + default_partner_ids=self.env.context['default_partner_ids'], + default_name=self.env.context['default_name'] ) defaults = super(CalendarEvent, self).default_get(fields) diff --git a/addons/hr_recruitment/models/hr_applicant.py b/addons/hr_recruitment/models/hr_applicant.py index 1eb3328a92e..966605491bf 100644 --- a/addons/hr_recruitment/models/hr_applicant.py +++ b/addons/hr_recruitment/models/hr_applicant.py @@ -30,7 +30,7 @@ class Applicant(models.Model): name = fields.Char("Subject / Application", required=True, help="Email subject for applications sent via email", index='trigram') 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.Html("Description") - email_from = fields.Char("Email", size=128, help="Applicant email", compute='_compute_partner_phone_email', + email_from = fields.Char("Email", size=128, compute='_compute_partner_phone_email', inverse='_inverse_partner_email', store=True, index='trigram') probability = fields.Float("Probability") partner_id = fields.Many2one('res.partner', "Contact", copy=False) @@ -50,7 +50,7 @@ class Applicant(models.Model): date_closed = fields.Datetime("Hire Date", compute='_compute_date_closed', store=True, readonly=False, tracking=True) date_open = fields.Datetime("Assigned", readonly=True) date_last_stage_update = fields.Datetime("Last Stage Update", index=True, default=fields.Datetime.now) - priority = fields.Selection(AVAILABLE_PRIORITIES, "Appreciation", default='0') + priority = fields.Selection(AVAILABLE_PRIORITIES, "Evaluation", default='0') job_id = fields.Many2one('hr.job', "Applied Job", domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", tracking=True, index=True) salary_proposed_extra = fields.Char("Proposed Salary Extra", help="Salary Proposed by the Organisation, extra advantages", tracking=True, groups="hr_recruitment.group_hr_recruitment_user") salary_expected_extra = fields.Char("Expected Salary Extra", help="Salary Expected by Applicant, extra advantages", tracking=True, groups="hr_recruitment.group_hr_recruitment_user") @@ -343,11 +343,11 @@ class Applicant(models.Model): alias_id = False nocontent_body = Markup(""" -

%(help_title)s

+

%(help_title)s

%(para_1)s
%(para_2)s

""") % { - 'help_title': _('No application yet'), - 'para_1': _('Let people apply by email to save time.'), - 'para_2': _('Attachments, like resumes, get indexed automatically.'), + 'help_title': _("No application found. Let's create one !"), + 'para_1': _('People can also apply by email to save time.'), + 'para_2': _("You can search into attachment's content, like resumes, with the searchbar."), } if alias_id and alias_id.alias_domain and alias_id.alias_name: @@ -379,6 +379,19 @@ class Applicant(models.Model): @return: Dictionary value for created Meeting view """ self.ensure_one() + + if not self.partner_id: + if not self.partner_name: + raise UserError(_('You must define a Contact Name for this applicant.')) + self.partner_id = self.env['res.partner'].create({ + 'is_company': False, + 'type': 'private', + 'name': self.partner_name, + 'email': self.email_from, + 'phone': self.partner_phone, + 'mobile': self.partner_mobile + }) + partners = self.partner_id | self.user_id.partner_id | self.department_id.manager_id.user_id.partner_id category = self.env.ref('hr_recruitment.categ_meet_interview') @@ -424,7 +437,8 @@ class Applicant(models.Model): 'view_mode': 'tree,kanban,form,pivot,graph,calendar,activity', 'domain': [('id', 'in', other_applicants.ids)], 'context': { - 'active_test': False + 'active_test': False, + 'search_default_stage': 1, }, } diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index e41b23b5793..03566776202 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -38,7 +38,7 @@ class Job(models.Model): 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") + 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( 'mail.alias', "Alias", ondelete="restrict", required=True, @@ -260,10 +260,9 @@ class Job(models.Model): 'default_res_id': self.ids[0], 'show_partner_name': 1, }, - 'view_mode': 'tree,form', + 'view_mode': 'tree', 'views': [ - (self.env.ref('hr_recruitment.ir_attachment_hr_recruitment_list_view').id, 'tree'), - (False, 'form'), + (self.env.ref('hr_recruitment.ir_attachment_hr_recruitment_list_view').id, 'tree') ], 'search_view_id': self.env.ref('hr_recruitment.ir_attachment_view_search_inherit_hr_recruitment').ids, 'domain': ['|', diff --git a/addons/hr_recruitment/views/hr_applicant_refuse_reason_views.xml b/addons/hr_recruitment/views/hr_applicant_refuse_reason_views.xml index a29b77350df..7838e945888 100644 --- a/addons/hr_recruitment/views/hr_applicant_refuse_reason_views.xml +++ b/addons/hr_recruitment/views/hr_applicant_refuse_reason_views.xml @@ -40,6 +40,7 @@ Refuse Reasons hr.applicant.refuse.reason tree,form + new diff --git a/addons/hr_recruitment/views/hr_applicant_views.xml b/addons/hr_recruitment/views/hr_applicant_views.xml index decd01253b8..3e992e1d472 100644 --- a/addons/hr_recruitment/views/hr_applicant_views.xml +++ b/addons/hr_recruitment/views/hr_applicant_views.xml @@ -9,11 +9,11 @@ - + - - - + + + @@ -113,7 +113,7 @@

@@ -125,22 +125,23 @@ - + + - + - +