Skip to content

Commit cfc53d8

Browse files
committed
[17.0][ADD] hr_recruitment_stage_active
1 parent 53aa3c4 commit cfc53d8

File tree

10 files changed

+223
-0
lines changed

10 files changed

+223
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
===========================
2+
HR Recruitment Stage Active
3+
===========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:bb6a35ee508aab10187b2af31f33313b34800356b7b63b84ca5cf0d4cf711da7
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
20+
:target: https://github.com/OCA/hr/tree/17.0/hr_recruitment_stage_active
21+
:alt: OCA/hr
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_recruitment_stage_active
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Adds an ``Active`` field to the ``hr.recruitment.stage`` model to be able to deactivate stages without deleting them
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Usage
39+
=====
40+
41+
Archive/unarchive recruitment stages.
42+
43+
Bug Tracker
44+
===========
45+
46+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
47+
In case of trouble, please check there if your issue has already been reported.
48+
If you spotted it first, help us to smash it by providing a detailed and welcomed
49+
`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**>`_.
50+
51+
Do not contact contributors directly about support or help with technical issues.
52+
53+
Credits
54+
=======
55+
56+
Contributors
57+
------------
58+
59+
- ``Camptocamp <https://www.camptocamp.com>``\ \_\_:
60+
61+
- Maksym Yankin [email protected]
62+
63+
Maintainers
64+
-----------
65+
66+
This module is maintained by the OCA.
67+
68+
.. image:: https://odoo-community.org/logo.png
69+
:alt: Odoo Community Association
70+
:target: https://odoo-community.org
71+
72+
OCA, or the Odoo Community Association, is a nonprofit organization whose
73+
mission is to support the collaborative development of Odoo features and
74+
promote its widespread use.
75+
76+
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.
77+
78+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 Camptocamp SA
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
{
4+
"name": "HR Recruitment Stage Active",
5+
"version": "17.0.1.0.0",
6+
"author": "Odoo Community Association (OCA), Camptocamp",
7+
"license": "AGPL-3",
8+
"category": "Human Resources/Recruitment",
9+
"website": "https://github.com/OCA/hr",
10+
"depends": [
11+
# odoo
12+
"hr_recruitment",
13+
],
14+
"data": [
15+
"views/hr_recruitment_stage.xml",
16+
],
17+
"installable": True,
18+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * hr_recruitment_stage_active
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0+e\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-11-01 12:08+0000\n"
10+
"PO-Revision-Date: 2024-11-01 12:08+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: hr_recruitment_stage_active
19+
#: model:ir.model.fields,field_description:hr_recruitment_stage_active.field_hr_recruitment_stage__active
20+
msgid "Active"
21+
msgstr ""
22+
23+
#. module: hr_recruitment_stage_active
24+
#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_form
25+
#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_search
26+
msgid "Archived"
27+
msgstr ""
28+
29+
#. module: hr_recruitment_stage_active
30+
#: model:ir.model,name:hr_recruitment_stage_active.model_hr_recruitment_stage
31+
msgid "Recruitment Stages"
32+
msgstr ""
33+
34+
#. module: hr_recruitment_stage_active
35+
#: model_terms:ir.ui.view,arch_db:hr_recruitment_stage_active.hr_recruitment_stage_search
36+
msgid "Search Recruitment Stages"
37+
msgstr ""
38+
39+
#. module: hr_recruitment_stage_active
40+
#: model:ir.model.fields,help:hr_recruitment_stage_active.field_hr_recruitment_stage__active
41+
msgid "The active field allows you to hide the stage without removing it."
42+
msgstr ""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import hr_recruitment_stage
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Camptocamp SA
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo import fields, models
5+
6+
7+
class RecruitmentStage(models.Model):
8+
_inherit = "hr.recruitment.stage"
9+
10+
active = fields.Boolean(
11+
help="The active field allows you to hide the stage without removing it.",
12+
default=True,
13+
tracking=True,
14+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import test_recruitment_stage
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2024 Camptocamp SA
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo.tests.common import TransactionCase
5+
6+
7+
class TestRecruitmentStage(TransactionCase):
8+
@classmethod
9+
def setUpClass(cls):
10+
super().setUpClass()
11+
cls.RecruitmentStage = cls.env["hr.recruitment.stage"]
12+
13+
def test_01_recruitment_stage(self):
14+
stage = self.RecruitmentStage.create({"name": "Overloaded"})
15+
self.assertTrue(stage.active, "Stage should be active by default")
16+
stage.action_archive()
17+
self.assertFalse(stage.active, "Stage should be inactive after archiving")
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
# Copyright 2024 Camptocamp SA
4+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5+
-->
6+
<odoo>
7+
<record id="hr_recruitment_stage_tree" model="ir.ui.view">
8+
<field name="model">hr.recruitment.stage</field>
9+
<field name="inherit_id" ref="hr_recruitment.hr_recruitment_stage_tree" />
10+
<field name="arch" type="xml">
11+
<field name="name" position="after">
12+
<field name="active" widget="boolean_toggle" />
13+
</field>
14+
</field>
15+
</record>
16+
<record id="hr_recruitment_stage_form" model="ir.ui.view">
17+
<field name="model">hr.recruitment.stage</field>
18+
<field name="inherit_id" ref="hr_recruitment.hr_recruitment_stage_form" />
19+
<field name="arch" type="xml">
20+
<group position="before">
21+
<widget
22+
name="web_ribbon"
23+
title="Archived"
24+
bg_color="bg-danger"
25+
invisible="active"
26+
/>
27+
</group>
28+
<field name="name" position="before">
29+
<field name="active" invisible="1" />
30+
</field>
31+
</field>
32+
</record>
33+
<record id="hr_recruitment_stage_search" model="ir.ui.view">
34+
<field name="name">hr.recruitment.stage.search</field>
35+
<field name="model">hr.recruitment.stage</field>
36+
<field name="arch" type="xml">
37+
<search string="Search Recruitment Stages">
38+
<field name="name" />
39+
<separator />
40+
<filter
41+
string="Archived"
42+
name="inactive"
43+
domain="[('active', '=', False)]"
44+
/>
45+
</search>
46+
</field>
47+
</record>
48+
</odoo>

0 commit comments

Comments
 (0)