-
-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[17.0][ADD] hr_recruitment_stage_active
- Loading branch information
Showing
9 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <https://github.com/OCA/partner-contact/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 <https://github.com/OCA/partner-contact/issues/new?body=module:%20hr_recruitment_stage_active%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
- ``Camptocamp <https://www.camptocamp.com>``\ \_\_: | ||
|
||
- Maksym Yankin [email protected] | ||
|
||
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 <https://github.com/OCA/partner-contact/tree/17.0/hr_recruitment_stage_active>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import hr_recruitment_stage |
14 changes: 14 additions & 0 deletions
14
hr_recruitment_stage_active/models/hr_recruitment_stage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_recruitment_stage |
17 changes: 17 additions & 0 deletions
17
hr_recruitment_stage_active/tests/test_recruitment_stage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
48 changes: 48 additions & 0 deletions
48
hr_recruitment_stage_active/views/hr_recruitment_stage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<record id="hr_recruitment_stage_tree" model="ir.ui.view"> | ||
<field name="model">hr.recruitment.stage</field> | ||
<field name="inherit_id" ref="hr_recruitment.hr_recruitment_stage_tree" /> | ||
<field name="arch" type="xml"> | ||
<field name="name" position="after"> | ||
<field name="active" widget="boolean_toggle" /> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="hr_recruitment_stage_form" model="ir.ui.view"> | ||
<field name="model">hr.recruitment.stage</field> | ||
<field name="inherit_id" ref="hr_recruitment.hr_recruitment_stage_form" /> | ||
<field name="arch" type="xml"> | ||
<group position="before"> | ||
<widget | ||
name="web_ribbon" | ||
title="Archived" | ||
bg_color="bg-danger" | ||
invisible="active" | ||
/> | ||
</group> | ||
<field name="name" position="before"> | ||
<field name="active" invisible="1" /> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="hr_recruitment_stage_search" model="ir.ui.view"> | ||
<field name="name">hr.recruitment.stage.search</field> | ||
<field name="model">hr.recruitment.stage</field> | ||
<field name="arch" type="xml"> | ||
<search string="Search Recruitment Stages"> | ||
<field name="name" /> | ||
<separator /> | ||
<filter | ||
string="Archived" | ||
name="inactive" | ||
domain="[('active', '=', False)]" | ||
/> | ||
</search> | ||
</field> | ||
</record> | ||
</odoo> |