Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][ADD] hr_recruitment_stage_active #1399

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions hr_recruitment_stage_active/README.rst
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.
1 change: 1 addition & 0 deletions hr_recruitment_stage_active/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions hr_recruitment_stage_active/__manifest__.py
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,
}
42 changes: 42 additions & 0 deletions hr_recruitment_stage_active/i18n/hr_recruitment_stage_active.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions hr_recruitment_stage_active/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_recruitment_stage
14 changes: 14 additions & 0 deletions hr_recruitment_stage_active/models/hr_recruitment_stage.py
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,
)
3 changes: 3 additions & 0 deletions hr_recruitment_stage_active/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions hr_recruitment_stage_active/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_recruitment_stage
17 changes: 17 additions & 0 deletions hr_recruitment_stage_active/tests/test_recruitment_stage.py
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 hr_recruitment_stage_active/views/hr_recruitment_stage.xml
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>
Loading