-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by AaronHForgeFlow
- Loading branch information
Showing
18 changed files
with
849 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
================= | ||
HR Operating Unit | ||
================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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%2Foperating--unit-lightgray.png?logo=github | ||
:target: https://github.com/OCA/operating-unit/tree/16.0/hr_operating_unit | ||
:alt: OCA/operating-unit | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/operating-unit-16-0/operating-unit-16-0-hr_operating_unit | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/operating-unit&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module introduces the following features: | ||
|
||
* Adds the Operating Unit (OU) to the Employee. | ||
|
||
* The Employees's default Operating Unit (OU) is proposed at the time of creation | ||
getting it from the logged user. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
Add the operating unit to Employee | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/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/operating-unit/issues/new?body=module:%20hr_operating_unit%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 | ||
~~~~~~~ | ||
|
||
* Gonzalo González Domínguez | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Gonzalo González Domínguez <meigallo@meigallodixital.com> | ||
* Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.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/operating-unit <https://github.com/OCA/operating-unit/tree/16.0/hr_operating_unit>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "HR Operating Unit", | ||
"version": "16.0.1.0.0", | ||
"author": "Gonzalo González Domínguez, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"website": "https://github.com/OCA/operating-unit", | ||
"category": "Human Resources", | ||
"depends": ["hr", "operating_unit"], | ||
"data": [ | ||
"security/security.xml", | ||
"views/hr_employee.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * hr_operating_unit | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-05-13 11:03+0000\n" | ||
"PO-Revision-Date: 2019-05-13 11:03+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"Language: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_hr_employee_base | ||
msgid "Basic Employee" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__default_operating_unit_id | ||
#: model_terms:ir.ui.view,arch_db:hr_operating_unit.view_employee_filter | ||
msgid "Default Operating Unit" | ||
msgstr "Unidad Operativa Actual" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__display_name | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__employee_ids | ||
msgid "Employees Allowed" | ||
msgstr "Empleados Permitidos" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base____last_update | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_operating_unit | ||
msgid "Operating Unit" | ||
msgstr "Unidad Operativa" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__operating_unit_ids | ||
msgid "Operating Units" | ||
msgstr "Unidades Operativas" | ||
|
||
#~ msgid "Employee" | ||
#~ msgstr "Empleado" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * hr_operating_unit | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2022-06-28 11:05+0000\n" | ||
"Last-Translator: Khalid Hazam <k.hazam@badep.ma>\n" | ||
"Language-Team: none\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" | ||
"X-Generator: Weblate 4.3.2\n" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_hr_employee_base | ||
#, fuzzy | ||
msgid "Basic Employee" | ||
msgstr "Employer" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__default_operating_unit_id | ||
#: model_terms:ir.ui.view,arch_db:hr_operating_unit.view_employee_filter | ||
msgid "Default Operating Unit" | ||
msgstr "Unité opérationnelle par défaut" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__display_name | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__display_name | ||
msgid "Display Name" | ||
msgstr "Nom affiché" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__employee_ids | ||
msgid "Employees Allowed" | ||
msgstr "Employés autorisés" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base____last_update | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière modification le" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_operating_unit | ||
msgid "Operating Unit" | ||
msgstr "Unité opérationnelle" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__operating_unit_ids | ||
msgid "Operating Units" | ||
msgstr "Unités opérationnelles" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * hr_operating_unit | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_hr_employee_base | ||
msgid "Basic Employee" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__default_operating_unit_id | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__default_operating_unit_id | ||
#: model_terms:ir.ui.view,arch_db:hr_operating_unit.view_employee_filter | ||
msgid "Default Operating Unit" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__employee_ids | ||
msgid "Employees Allowed" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model,name:hr_operating_unit.model_operating_unit | ||
msgid "Operating Unit" | ||
msgstr "" | ||
|
||
#. module: hr_operating_unit | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__operating_unit_ids | ||
#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__operating_unit_ids | ||
msgid "Operating Units" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import hr_employee_base | ||
from . import hr_operating_unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class HrEmployeeBase(models.AbstractModel): | ||
_inherit = "hr.employee.base" | ||
|
||
operating_unit_ids = fields.Many2many( | ||
comodel_name="operating.unit", | ||
relation="operating_unit_employees_rel", | ||
column1="employee_id", | ||
column2="operating_unit_id", | ||
string="Operating Units", | ||
default=lambda self: (self.env["res.users"].operating_unit_default_get()), | ||
) | ||
|
||
default_operating_unit_id = fields.Many2one( | ||
comodel_name="operating.unit", | ||
string="Default Operating Unit", | ||
default=lambda self: (self.env["res.users"].operating_unit_default_get()), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class OperatingUnit(models.Model): | ||
_inherit = "operating.unit" | ||
|
||
employee_ids = fields.Many2many( | ||
"hr.employee", | ||
"operating_unit_employees_rel", | ||
"operating_unit_id", | ||
"employee_id", | ||
"Employees Allowed", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Gonzalo González Domínguez <meigallo@meigallodixital.com> | ||
* Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This module introduces the following features: | ||
|
||
* Adds the Operating Unit (OU) to the Employee. | ||
|
||
* The Employees's default Operating Unit (OU) is proposed at the time of creation | ||
getting it from the logged user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add the operating unit to Employee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="ir_rule_hr_allowed_operating_units" model="ir.rule"> | ||
<field name="model_id" ref="hr.model_hr_employee" /> | ||
<field | ||
name="domain_force" | ||
>['|',('default_operating_unit_id','=',False),('default_operating_unit_id','in', user.operating_unit_ids.ids)]</field> | ||
<field name="name">Allowed Operating Units for Employee</field> | ||
<field eval="0" name="perm_unlink" /> | ||
<field eval="0" name="perm_write" /> | ||
<field eval="1" name="perm_read" /> | ||
<field eval="0" name="perm_create" /> | ||
<field name="global" eval="True" /> | ||
</record> | ||
|
||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.