diff --git a/hr_recruitment_ux/README.rst b/hr_recruitment_ux/README.rst new file mode 100644 index 0000000..98c5aeb --- /dev/null +++ b/hr_recruitment_ux/README.rst @@ -0,0 +1,75 @@ +.. |company| replace:: ADHOC SA + +.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png + :alt: ADHOC SA + :target: https://www.adhoc.com.ar + +.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png + +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +================== +HR Recruitment UX +================== + +This module adds: + +* Automatically archives applicants when they are added to a talent pool +* Per-vacancy rotting SLA: allows configuring specific "days to rot" on each job position, + overriding the stage threshold when needed. When enabled on a vacancy, applicants in that + position use the vacancy's threshold instead of the pipeline stage's. + +Installation +============ + +To install this module, you need to: + +#. Just install this module + +Configuration +============= + +To configure this module, you need to: + +#. Nothing to configure + +Usage +===== + +To use this module, you need to: + +#. Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: http://runbot.adhoc.com.ar/ + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* |company| |icon| + +Contributors +------------ + +Maintainer +---------- + +|company_logo| + +This module is maintained by ADHOC SA. + +To contribute to this module, please visit https://www.adhoc.com.ar. diff --git a/hr_recruitment_ux/__init__.py b/hr_recruitment_ux/__init__.py new file mode 100644 index 0000000..31660d6 --- /dev/null +++ b/hr_recruitment_ux/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/hr_recruitment_ux/__manifest__.py b/hr_recruitment_ux/__manifest__.py new file mode 100644 index 0000000..d025b3a --- /dev/null +++ b/hr_recruitment_ux/__manifest__.py @@ -0,0 +1,39 @@ +############################################################################## +# +# Copyright (C) 2026 ADHOC SA (http://www.adhoc.com.ar) +# All Rights Reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Recruitment UX", + "version": "19.0.1.0.0", + "category": "Human Resources", + "sequence": 14, + "author": "ADHOC SA", + "website": "www.adhoc.com.ar", + "license": "AGPL-3", + "summary": "", + "depends": [ + "hr_recruitment", + ], + "data": [ + "views/hr_job_views.xml", + ], + "demo": [], + "installable": True, + "auto_install": True, + "application": False, +} diff --git a/hr_recruitment_ux/models/__init__.py b/hr_recruitment_ux/models/__init__.py new file mode 100644 index 0000000..912de22 --- /dev/null +++ b/hr_recruitment_ux/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import hr_applicant +from . import hr_job +from . import talent_pool_add_applicants diff --git a/hr_recruitment_ux/models/hr_applicant.py b/hr_recruitment_ux/models/hr_applicant.py new file mode 100644 index 0000000..052f425 --- /dev/null +++ b/hr_recruitment_ux/models/hr_applicant.py @@ -0,0 +1,32 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from datetime import timedelta + +from odoo import api, models + + +class HrApplicant(models.Model): + _inherit = "hr.applicant" + + def _get_rotting_depends_fields(self): + return super()._get_rotting_depends_fields() + [ + "job_id.use_rotting_per_job", + "job_id.rotting_threshold_days", + ] + + @api.depends(lambda self: self._get_rotting_depends_fields()) + def _compute_rotting(self): + super()._compute_rotting() + now = self.env.cr.now() + per_job = self.filtered( + lambda r: r.job_id.use_rotting_per_job and r.application_status == "ongoing" and not r.date_closed + ) + for applicant in per_job: + threshold = applicant.job_id.rotting_threshold_days + date_ref = applicant.date_last_stage_update or applicant.create_date + if threshold and date_ref and (date_ref + timedelta(days=threshold)) < now: + applicant.is_rotting = True + applicant.rotting_days = (now - date_ref).days + else: + applicant.is_rotting = False + applicant.rotting_days = 0 diff --git a/hr_recruitment_ux/models/hr_job.py b/hr_recruitment_ux/models/hr_job.py new file mode 100644 index 0000000..18fa08f --- /dev/null +++ b/hr_recruitment_ux/models/hr_job.py @@ -0,0 +1,20 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HrJob(models.Model): + _inherit = "hr.job" + + use_rotting_per_job = fields.Boolean( + string="Usar días para deteriorarse por vacante", + help="Cuando está activo, los días para deteriorarse se configuran a nivel de vacante " + "en lugar de usar los días configurados en la etapa.", + ) + rotting_threshold_days = fields.Integer( + string="Días para deteriorarse", + default=0, + help="Cantidad de días antes de que los postulantes de esta vacante se deterioren. " + "Se usa solo cuando 'Usar días para deteriorarse por vacante' está activo. " + "0 = sin deterioro para esta vacante.", + ) diff --git a/hr_recruitment_ux/models/talent_pool_add_applicants.py b/hr_recruitment_ux/models/talent_pool_add_applicants.py new file mode 100644 index 0000000..8a24124 --- /dev/null +++ b/hr_recruitment_ux/models/talent_pool_add_applicants.py @@ -0,0 +1,13 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class TalentPoolAddApplicants(models.TransientModel): + _inherit = "talent.pool.add.applicants" + + def action_add_applicants_to_pool(self): + result = super().action_add_applicants_to_pool() + # Archive the original applicants after adding them to the talent pool + self.applicant_ids.write({"active": False}) + return result diff --git a/hr_recruitment_ux/views/hr_job_views.xml b/hr_recruitment_ux/views/hr_job_views.xml new file mode 100644 index 0000000..883d17d --- /dev/null +++ b/hr_recruitment_ux/views/hr_job_views.xml @@ -0,0 +1,17 @@ + + + + + hr.job.form.inherit.recruitment.ux + hr.job + + + + + + + + + +