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

[ADD] hr_employee_document_from_applicant #1343

Merged
Merged
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
6 changes: 3 additions & 3 deletions hr_employee_calendar_planning/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,20 @@ class HrEmployeeCalendar(models.Model):

@api.model_create_multi
def create(self, vals):
res = super(HrEmployeeCalendar, self).create(vals)
res = super().create(vals)
for employee in res.mapped("employee_id"):
employee._regenerate_calendar()
return res

def write(self, vals):
res = super(HrEmployeeCalendar, self).write(vals)
res = super().write(vals)
for employee in self.mapped("employee_id"):
employee._regenerate_calendar()
return res

def unlink(self):
employees = self.mapped("employee_id")
res = super(HrEmployeeCalendar, self).unlink()
res = super().unlink()
for employee in employees:
employee._regenerate_calendar()
return res
2 changes: 1 addition & 1 deletion hr_employee_calendar_planning/models/resource_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _check_company_id(self):
)

def write(self, vals):
res = super(ResourceCalendar, self).write(vals)
res = super().write(vals)
if "attendance_ids" in vals or "global_leave_ids" in vals:
for record in self.filtered(lambda x: not x.auto_generate):
calendars = self.env["hr.employee.calendar"].search(
Expand Down
97 changes: 97 additions & 0 deletions hr_employee_document_from_applicant/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
===================================
HR Employee Document from Applicant
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1502bb5c39119a2c59b296bda83f0ed431fb3668c2be81dd029be846cbb9dab8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/16.0/hr_employee_document_from_applicant
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_document_from_applicant
: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=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to move all the documents attached to a candidate to
the employee when the candidate is hired.

**Table of contents**

.. contents::
:local:

Usage
=====

* Go to Recruitment
* Create a job position and a candidate
* Attach documents to the candidate
* Move the candidate through the recruitment process until the "Create employee" button appears to click on it
* Go to the newly created employee: all the documents of the candidate are available

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/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/hr/issues/new?body=module:%20hr_employee_document_from_applicant%0Aversion:%2016.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
=======

Authors
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* `Open Source Integrators <https://www.opensourceintegrators.com/>`__

* Samuel Macias Oropeza <[email protected]>
* Maxime Chambreuil <[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.

.. |maintainer-ursais| image:: https://github.com/ursais.png?size=40px
:target: https://github.com/ursais
:alt: ursais

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ursais|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/hr_employee_document_from_applicant>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions hr_employee_document_from_applicant/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2024 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
15 changes: 15 additions & 0 deletions hr_employee_document_from_applicant/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2024 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "HR Employee Document from Applicant",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"summary": "HR Employee Document from Applicant",
"author": "Odoo Community Association (OCA), Open Source Integrators",
"maintainer": "Open Source Integrators",
"website": "https://github.com/OCA/hr",
"depends": ["hr_employee_document", "hr_recruitment"],
"data": [],
"maintainers": ["ursais"],
}
21 changes: 21 additions & 0 deletions hr_employee_document_from_applicant/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_document_from_applicant
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e-20230816\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-23 18:00+0000\n"
"PO-Revision-Date: 2024-04-23 18:00+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_employee_document_from_applicant
#: model:ir.model,name:hr_employee_document_from_applicant.model_hr_employee
msgid "Employee"
msgstr "Empleado"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_document_from_applicant
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e-20230816\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-23 18:00+0000\n"
"PO-Revision-Date: 2024-04-23 18:00+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_employee_document_from_applicant
#: model:ir.model,name:hr_employee_document_from_applicant.model_hr_employee
msgid "Employee"
msgstr ""
4 changes: 4 additions & 0 deletions hr_employee_document_from_applicant/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2024 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_employee
30 changes: 30 additions & 0 deletions hr_employee_document_from_applicant/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (C) 2024 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import api, models


class HrEmployee(models.Model):
_inherit = "hr.employee"

@api.model_create_multi
def create(self, vals_list):
employees = super().create(vals_list)
for employee in employees:
if employee.applicant_id:
irAttachments = (

Check warning on line 16 in hr_employee_document_from_applicant/models/hr_employee.py

View check run for this annotation

Codecov / codecov/patch

hr_employee_document_from_applicant/models/hr_employee.py#L16

Added line #L16 was not covered by tests
self.env["ir.attachment"]
.sudo()
.search(
[
("res_model", "=", "hr.applicant"),
("res_id", "=", employee.applicant_id.id),
]
)
)
for attachment in irAttachments:
attachment.write(

Check warning on line 27 in hr_employee_document_from_applicant/models/hr_employee.py

View check run for this annotation

Codecov / codecov/patch

hr_employee_document_from_applicant/models/hr_employee.py#L27

Added line #L27 was not covered by tests
{"res_model": "hr.employee", "res_id": employee.id}
)
return employees
4 changes: 4 additions & 0 deletions hr_employee_document_from_applicant/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Open Source Integrators <https://www.opensourceintegrators.com/>`__

* Samuel Macias Oropeza <[email protected]>
* Maxime Chambreuil <[email protected]>
2 changes: 2 additions & 0 deletions hr_employee_document_from_applicant/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows you to move all the documents attached to a candidate to
the employee when the candidate is hired.
5 changes: 5 additions & 0 deletions hr_employee_document_from_applicant/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Go to Recruitment
* Create a job position and a candidate
* Attach documents to the candidate
* Move the candidate through the recruitment process until the "Create employee" button appears to click on it
* Go to the newly created employee: all the documents of the candidate are available
Loading
Loading