Skip to content

Commit

Permalink
[ADD] hr_hide_info: Hide information for some users. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berezi authored Jun 23, 2021
1 parent de65933 commit 48b855a
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 0 deletions.
28 changes: 28 additions & 0 deletions hr_hide_info/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

============
Hr hide info
============

* Hide information for some users.

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

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/hr-addons/issues>`_. In case of trouble,
please check there if your issue has already been reported. If you spotted
it first, help us smash it by providing detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Contributors
------------

* Berezi Amubieta <[email protected]>
* Alfredo de la Fuente <[email protected]>
1 change: 1 addition & 0 deletions hr_hide_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions hr_hide_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2021 Berezi - Iker - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Hr hide info",
'version': '14.0.1.0.0',
"author": "Avanzosc",
"category": "Sales/CRM",
"depends": [
"hr"
],
"data": [
"views/hr_employee_views.xml"
],
"license": "AGPL-3",
'installable': True,
}
47 changes: 47 additions & 0 deletions hr_hide_info/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_hide_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-06-23 08:06+0000\n"
"PO-Revision-Date: 2021-06-23 08:06+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_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: hr_hide_info
#: model:ir.model,name:hr_hide_info.model_hr_employee
msgid "Employee"
msgstr "Empleado"

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__id
msgid "ID"
msgstr ""

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: hr_hide_info
#: model:ir.actions.act_window,name:hr_hide_info.open_view_my_file
#: model:ir.ui.menu,name:hr_hide_info.menu_my_hr_employee
msgid "My employee file"
msgstr "Mi ficha de empleado"

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__personal_private_email
msgid "Personal private email"
msgstr "Correo personal privado"
47 changes: 47 additions & 0 deletions hr_hide_info/i18n/hr_hide_info.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_hide_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-06-23 08:05+0000\n"
"PO-Revision-Date: 2021-06-23 08:05+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_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__display_name
msgid "Display Name"
msgstr ""

#. module: hr_hide_info
#: model:ir.model,name:hr_hide_info.model_hr_employee
msgid "Employee"
msgstr ""

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__id
msgid "ID"
msgstr ""

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee____last_update
msgid "Last Modified on"
msgstr ""

#. module: hr_hide_info
#: model:ir.actions.act_window,name:hr_hide_info.open_view_my_file
#: model:ir.ui.menu,name:hr_hide_info.menu_my_hr_employee
msgid "My employee file"
msgstr ""

#. module: hr_hide_info
#: model:ir.model.fields,field_description:hr_hide_info.field_hr_employee__personal_private_email
msgid "Personal private email"
msgstr ""
1 change: 1 addition & 0 deletions hr_hide_info/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_employee
9 changes: 9 additions & 0 deletions hr_hide_info/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2021 Berezi - Iker - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields


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

personal_private_email = fields.Char(string='Personal private email')
34 changes: 34 additions & 0 deletions hr_hide_info/views/hr_employee_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_employee_form" model="ir.ui.view">
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="private_email" position="after">
<field name="personal_private_email"/>
</field>
<page name="personal_information" position="attributes">
<attribute name="groups">hr.group_hr_manager</attribute>
</page>
<page name="hr_settings" position="attributes">
<attribute name="groups">hr.group_hr_manager</attribute>
</page>
</field>
</record>

<record id="open_view_my_file" model="ir.actions.act_window">
<field name="name">My employee file</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="res_model">hr.employee</field>
<field name="view_id" ref="hr.view_employee_tree"/>
<field name="domain">[('user_id', '=', uid)]</field>
<field name="context">{}</field>
</record>

<menuitem id="menu_my_hr_employee"
action="open_view_my_file"
name="My employee file"
parent="hr.menu_hr_employee_payroll"
sequence="2"/>
</odoo>

0 comments on commit 48b855a

Please sign in to comment.