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

[15.0][MIG] hr_employee_product #493

Merged
merged 20 commits into from
Oct 11, 2022
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
93 changes: 93 additions & 0 deletions hr_employee_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
======================================
Manage products representing employees
======================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/15.0/hr_employee_product
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-hr_employee_product
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/117/15.0
:alt: Try me on Runbot

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


This module was written to extend the Timesheet capabilities of Odoo.

It allows to restrict the access to the products that represent an actual
employee, only to the Human Resources / Manager group.

A company may want to record an actual hourly cost per employee, so that the
time entered by employees through timesheets can result in a more realistic
cost, but at the same time want to conceal this information to general
employees.

**Table of contents**

.. contents::
:local:

Usage
=====


A user in the group 'Human Resources / Manager' should go to the product form
and set the checkbox 'Is Employee'. This product will then be accessible only
by this group.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/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/OCA/timesheet/issues/new?body=module:%20hr_employee_product%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
~~~~~~~

* Eficent

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


* Jordi Ballester <jordi.ballester@eficent.com>
* Aaron Henriquez <ahenriquez@eficent.com>
* Juany Davila <juany.davila@forgeflow.com>

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/timesheet <https://github.com/OCA/timesheet/tree/15.0/hr_employee_product>`_ project on GitHub.

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

from . import model
15 changes: 15 additions & 0 deletions hr_employee_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2015-17 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).

{
"name": "Manage products representing employees",
"version": "15.0.1.0.0",
"category": "Human Resources",
"author": "Eficent, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/timesheet",
"license": "AGPL-3",
"summary": "Product is an employee",
"depends": ["product", "hr_timesheet"],
"data": ["security/product_security.xml", "view/product.xml"],
"installable": True,
}
31 changes: 31 additions & 0 deletions hr_employee_product/i18n/cs_CZ.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
# Translators:
# Lukáš Spurný <lukasspurny8@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 01:55+0000\n"
"PO-Revision-Date: 2018-02-23 01:55+0000\n"
"Last-Translator: Lukáš Spurný <lukasspurny8@gmail.com>, 2018\n"
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/"
"teams/23907/cs_CZ/)\n"
"Language: cs_CZ\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr "Je zaměstnancem"

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr "Šablona produktu"
30 changes: 30 additions & 0 deletions hr_employee_product/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
# Translators:
# enjolras <yo@miguelrevilla.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-03 05:20+0000\n"
"PO-Revision-Date: 2018-03-03 05:20+0000\n"
"Last-Translator: enjolras <yo@miguelrevilla.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr "Es un empleado"

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
30 changes: 30 additions & 0 deletions hr_employee_product/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
# Translators:
# Quentin THEURET <odoo@kerpeo.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 01:55+0000\n"
"PO-Revision-Date: 2018-02-23 01:55+0000\n"
"Last-Translator: Quentin THEURET <odoo@kerpeo.com>, 2018\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr "Est un employé"

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr "Modèle de produit"
40 changes: 40 additions & 0 deletions hr_employee_product/i18n/hr_employee_product.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \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_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__display_name
msgid "Display Name"
msgstr ""

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__id
msgid "ID"
msgstr ""

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr ""

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template____last_update
msgid "Last Modified on"
msgstr ""

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr ""
31 changes: 31 additions & 0 deletions hr_employee_product/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
# Translators:
# Marco Calcagni <mcalcagni@dinamicheaziendali.it>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-31 04:45+0000\n"
"PO-Revision-Date: 2018-10-28 23:03+0000\n"
"Last-Translator: Sergio Zanchetta <primes2h@gmail.com>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.2.1\n"

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr "È un dipendente"

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr "Modello prodotto"
28 changes: 28 additions & 0 deletions hr_employee_product/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-26 16:19+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
"Language-Team: none\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: hr_employee_product
#: model:ir.model.fields,field_description:hr_employee_product.field_product_product__is_employee
#: model:ir.model.fields,field_description:hr_employee_product.field_product_template__is_employee
msgid "Is an Employee"
msgstr "É Funcionário"

#. module: hr_employee_product
#: model:ir.model,name:hr_employee_product.model_product_template
msgid "Product Template"
msgstr "Modelo de Produto"
3 changes: 3 additions & 0 deletions hr_employee_product/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).

from . import product
9 changes: 9 additions & 0 deletions hr_employee_product/model/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2015-17 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

is_employee = fields.Boolean(string="Is an Employee")
4 changes: 4 additions & 0 deletions hr_employee_product/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

* Jordi Ballester <jordi.ballester@eficent.com>
* Aaron Henriquez <ahenriquez@eficent.com>
* Juany Davila <juany.davila@forgeflow.com>
10 changes: 10 additions & 0 deletions hr_employee_product/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

This module was written to extend the Timesheet capabilities of Odoo.

It allows to restrict the access to the products that represent an actual
employee, only to the Human Resources / Manager group.

A company may want to record an actual hourly cost per employee, so that the
time entered by employees through timesheets can result in a more realistic
cost, but at the same time want to conceal this information to general
employees.
4 changes: 4 additions & 0 deletions hr_employee_product/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

A user in the group 'Human Resources / Manager' should go to the product form
and set the checkbox 'Is Employee'. This product will then be accessible only
by this group.
22 changes: 22 additions & 0 deletions hr_employee_product/security/product_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Copyright 2015-17 Eficent Business and IT Consulting Services S.L.-->
<!--License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).-->
<odoo>
<record id="property_rule_product_employee_user" model="ir.rule">
<field
name="name"
>Employees cannot view products that represent employees</field>
<field name="model_id" ref="product.model_product_template" />
<field name="domain_force">[('is_employee', '=', False)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]" />
</record>

<record id="property_rule_product_employee_hr_manager" model="ir.rule">
<field
name="name"
>HR Managers can view products that represent employees</field>
<field name="model_id" ref="product.model_product_template" />
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4,ref('hr.group_hr_manager'))]" />
</record>
</odoo>
Binary file added hr_employee_product/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading