Skip to content

Commit

Permalink
[IMP] #1086742 smile_anonymization_hr : migration to V15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imane authored and Rahma ROUMANI committed Aug 10, 2022
1 parent da2ee68 commit c8ef9ab
Show file tree
Hide file tree
Showing 11 changed files with 614 additions and 0 deletions.
73 changes: 73 additions & 0 deletions smile_anonymization_hr/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
===========================
Database Anonymization - HR
===========================

.. |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-Smile_SA%2Fodoo_addons-lightgray.png?logo=github
:target: https://github.com/Smile-SA/odoo_addons/tree/15.0/smile_anonymization_hr
:alt: Smile-SA/odoo_addons

|badge2| |badge3|

This module extends the module `smile_anonymization <https://github.com/Smile-SA/odoo_addons/tree/15.0/smile_anonymization_hr>`_.
After installing it, all sensitive data related to Human Resources will
be anonymized in database backups.

**Table of contents**

.. contents::
:local:

Usage
=====

Go to database manager and backup the desired database. You will
download a anonymized backup.

Requirements
============

There are no requirements to use this module.

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

Bugs are tracked on `GitHub Issues <https://github.com/Smile-SA/odoo_addons/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/Smile-SA/odoo_addons/issues/new?body=module:%smile_anonymization_hr%0Aversion:%2015.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
~~~~~~~

* Smile SA

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

* Corentin Pouhet-Brunerie
* Ismail EL BAKKALI

Maintainers
~~~~~~~~~~~

This module is maintained by the Smile SA.

Since 1991 Smile has been a pioneer of technology and also the European
expert in open source solutions.

.. image:: https://avatars0.githubusercontent.com/u/572339?s=200&v=4
:alt: Smile SA
:target: https://www.smile.eu

This module is part of the `odoo-addons <https://github.com/Smile-SA/odoo_addons>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions smile_anonymization_hr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
23 changes: 23 additions & 0 deletions smile_anonymization_hr/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Database Anonymization - HR",
"version": "0.1",
"depends": [
"hr",
"smile_anonymization",
],
"author": "Smile",
"license": 'AGPL-3',
"description": "",
"summary": "",
"website": "https://www.smile.eu",
"category": 'Tools',
"sequence": 20,
"data": [],
"auto_install": True,
"installable": True,
"application": False,
}
9 changes: 9 additions & 0 deletions smile_anonymization_hr/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import hr_department
from . import hr_employee
from . import resource_calendar_leaves
from . import resource_calendar
from . import resource_resource
13 changes: 13 additions & 0 deletions smile_anonymization_hr/models/hr_department.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class HrDepartment(models.Model):
_inherit = 'hr.department'

name = fields.Char(data_mask="'department_' || id::text")
complete_name = fields.Char(data_mask="'department_' || id::text")
parent_id = fields.Many2one(data_mask="NULL")
27 changes: 27 additions & 0 deletions smile_anonymization_hr/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

name = fields.Char(data_mask="'employee_' || id::text")
name_related = fields.Char(data_mask="'resource_' || resource_id::text")
birthday = fields.Date(data_mask="NULL")
ssnid = fields.Char(data_mask="NULL")
sinid = fields.Char(data_mask="NULL")
identification_id = fields.Char(data_mask="NULL")
gender = fields.Selection(data_mask="'other'")
marital = fields.Selection(data_mask="NULL")
work_phone = fields.Char(data_mask="NULL")
mobile_phone = fields.Char(data_mask="NULL")
work_email = fields.Char(data_mask="NULL")
work_location = fields.Char(data_mask="NULL")
notes = fields.Text(data_mask="NULL")
parent_id = fields.Many2one(data_mask="NULL")
coach_id = fields.Many2one(data_mask="NULL")
job_id = fields.Many2one(data_mask="NULL")
passport_id = fields.Char(data_mask="NULL")
11 changes: 11 additions & 0 deletions smile_anonymization_hr/models/resource_calendar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'

name = fields.Char(data_mask="'calendar_' || id::text")
11 changes: 11 additions & 0 deletions smile_anonymization_hr/models/resource_calendar_leaves.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResourceCalendarLeaves(models.Model):
_inherit = 'resource.calendar.leaves'

name = fields.Char(data_mask="'leaves_' || id::text")
13 changes: 13 additions & 0 deletions smile_anonymization_hr/models/resource_resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# (C) 2019 Smile (<https://www.smile.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResourceResource(models.Model):
_inherit = 'resource.resource'

name = fields.Char(
data_mask="'resource_' || id::text WHERE resource_type = 'user'")
code = fields.Char(data_mask="NULL")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c8ef9ab

Please sign in to comment.