diff --git a/hr_recruitment_stage_active/README.rst b/hr_recruitment_stage_active/README.rst new file mode 100644 index 00000000000..251990a0208 --- /dev/null +++ b/hr_recruitment_stage_active/README.rst @@ -0,0 +1,78 @@ +=========================== +HR Recruitment Stage Active +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bb6a35ee508aab10187b2af31f33313b34800356b7b63b84ca5cf0d4cf711da7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github + :target: https://github.com/OCA/hr/tree/17.0/hr_recruitment_stage_active + :alt: OCA/hr +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_recruitment_stage_active + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds an ``Active`` field to the ``hr.recruitment.stage`` model to be able to deactivate stages without deleting them + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Archive/unarchive recruitment stages. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Contributors +------------ + +- ``Camptocamp ``\ \_\_: + + - Maksym Yankin maksym.yankin@camptocamp.com + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_recruitment_stage_active/__init__.py b/hr_recruitment_stage_active/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/hr_recruitment_stage_active/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/hr_recruitment_stage_active/__manifest__.py b/hr_recruitment_stage_active/__manifest__.py new file mode 100644 index 00000000000..10178d413f6 --- /dev/null +++ b/hr_recruitment_stage_active/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "HR Recruitment Stage Active", + "version": "17.0.1.0.0", + "author": "Odoo Community Association (OCA), Camptocamp", + "license": "AGPL-3", + "category": "Human Resources/Recruitment", + "website": "https://github.com/OCA/hr", + "depends": [ + # odoo + "hr_recruitment", + ], + "data": [ + "views/hr_recruitment_stage.xml", + ], + "installable": True, +} diff --git a/hr_recruitment_stage_active/i18n/hr_recruitment_stage_active.pot b/hr_recruitment_stage_active/i18n/hr_recruitment_stage_active.pot new file mode 100644 index 00000000000..a837402137c --- /dev/null +++ b/hr_recruitment_stage_active/i18n/hr_recruitment_stage_active.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_recruitment_stage_active +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-01 12:08+0000\n" +"PO-Revision-Date: 2024-11-01 12:08+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_recruitment_stage_active +#: model:ir.model.fields,field_description:hr_recruitment_stage_active.field_hr_recruitment_stage__active +msgid "Active" +msgstr "" + +#. module: hr_recruitment_stage_active +#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_form +#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_search +msgid "Archived" +msgstr "" + +#. module: hr_recruitment_stage_active +#: model:ir.model,name:hr_recruitment_stage_active.model_hr_recruitment_stage +msgid "Recruitment Stages" +msgstr "" + +#. module: hr_recruitment_stage_active +#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_search +msgid "Search Recruitment Stages" +msgstr "" + +#. module: hr_recruitment_stage_active +#: model:ir.model.fields,help:hr_recruitment_stage_active.field_hr_recruitment_stage__active +msgid "The active field allows you to hide the stage without removing it." +msgstr "" diff --git a/hr_recruitment_stage_active/models/__init__.py b/hr_recruitment_stage_active/models/__init__.py new file mode 100644 index 00000000000..533dfe29148 --- /dev/null +++ b/hr_recruitment_stage_active/models/__init__.py @@ -0,0 +1 @@ +from . import hr_recruitment_stage diff --git a/hr_recruitment_stage_active/models/hr_recruitment_stage.py b/hr_recruitment_stage_active/models/hr_recruitment_stage.py new file mode 100644 index 00000000000..297ff56fe68 --- /dev/null +++ b/hr_recruitment_stage_active/models/hr_recruitment_stage.py @@ -0,0 +1,14 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class RecruitmentStage(models.Model): + _inherit = "hr.recruitment.stage" + + active = fields.Boolean( + help="The active field allows you to hide the stage without removing it.", + default=True, + tracking=True, + ) diff --git a/hr_recruitment_stage_active/pyproject.toml b/hr_recruitment_stage_active/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/hr_recruitment_stage_active/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_recruitment_stage_active/tests/__init__.py b/hr_recruitment_stage_active/tests/__init__.py new file mode 100644 index 00000000000..d6a3ce65c5b --- /dev/null +++ b/hr_recruitment_stage_active/tests/__init__.py @@ -0,0 +1 @@ +from . import test_recruitment_stage diff --git a/hr_recruitment_stage_active/tests/test_recruitment_stage.py b/hr_recruitment_stage_active/tests/test_recruitment_stage.py new file mode 100644 index 00000000000..d199f10c710 --- /dev/null +++ b/hr_recruitment_stage_active/tests/test_recruitment_stage.py @@ -0,0 +1,17 @@ +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestRecruitmentStage(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.RecruitmentStage = cls.env["hr.recruitment.stage"] + + def test_01_recruitment_stage(self): + stage = self.RecruitmentStage.create({"name": "Overloaded"}) + self.assertTrue(stage.active, "Stage should be active by default") + stage.action_archive() + self.assertFalse(stage.active, "Stage should be inactive after archiving") diff --git a/hr_recruitment_stage_active/views/hr_recruitment_stage.xml b/hr_recruitment_stage_active/views/hr_recruitment_stage.xml new file mode 100644 index 00000000000..20c337625e9 --- /dev/null +++ b/hr_recruitment_stage_active/views/hr_recruitment_stage.xml @@ -0,0 +1,48 @@ + + + + + hr.recruitment.stage + + + + + + + + + hr.recruitment.stage + + + + + + + + + + + + hr.recruitment.stage.search + hr.recruitment.stage + + + + + + + + +