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

[16.0][MIG] hr_branch #1246

Closed
wants to merge 14 commits into from
85 changes: 85 additions & 0 deletions hr_branch/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
=========
HR Branch
=========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-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_branch
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_branch
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/116/16.0
:alt: Try me on Runbot

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

This module allows define the company branches, and allow indicate the
employees by each one.

To allow define the employee branch, is necessary to assign the correct
branch on the department.

**Table of contents**

.. contents::
:local:

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_branch%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
~~~~~~~

* Vauxoo

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

* Luis Torres <[email protected]> (vauxoo.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.

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

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

|maintainer-luistorresm|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/hr_branch>`_ 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_branch/__init__.py
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
21 changes: 21 additions & 0 deletions hr_branch/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "HR Branch",
"summary": "Allow define company branch for employee process",
"version": "16.0.1.0.0",
"development_status": "Mature",
"category": "Human Resources",
"website": "https://github.com/OCA/hr",
"author": "Vauxoo, Odoo Community Association (OCA)",
"maintainers": ["luistorresm"],
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["hr"],
"data": [
"views/hr_department_views.xml",
"views/hr_employee_views.xml",
],
"demo": [],
"qweb": [],
}
40 changes: 40 additions & 0 deletions hr_branch/i18n/de.po
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_branch
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-05-11 13:05+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
"Language-Team: none\n"
"Language: de\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_branch
#: model:ir.model.fields,field_description:hr_branch.field_hr_department__branch_id
msgid "Branch"
msgstr ""

#. module: hr_branch
#: model:ir.model,name:hr_branch.model_hr_department
msgid "Department"
msgstr "Abteilung"

#. module: hr_branch
#: model:ir.model.fields,help:hr_branch.field_hr_department__branch_id
msgid ""
"Indicate the department branch, to ensure that the employees are assigned "
"correctly"
msgstr ""

#~ msgid "Display Name"
#~ msgstr "Anzeigename"

#~ msgid "ID"
#~ msgstr "ID"
39 changes: 39 additions & 0 deletions hr_branch/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_branch
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-08 07:44+0000\n"
"PO-Revision-Date: 2020-09-08 07:44+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_branch
#: model:ir.model.fields,field_description:hr_branch.field_hr_department__branch_id
msgid "Branch"
msgstr "Sucursal"

#. module: hr_branch
#: model:ir.model,name:hr_branch.model_hr_department
msgid "Department"
msgstr ""

#. module: hr_branch
#: model:ir.model.fields,help:hr_branch.field_hr_department__branch_id
msgid ""
"Indicate the department branch, to ensure that the employees are assigned "
"correctly"
msgstr ""
"Indique la sucursal del departamento, para asegurarse que el empleado es "
"asignado correctamente"

#~ msgid "HR Department"
#~ msgstr "Departamento Recursos Humanos"
31 changes: 31 additions & 0 deletions hr_branch/i18n/hr_branch.pot
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_branch
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_branch
#: model:ir.model.fields,field_description:hr_branch.field_hr_department__branch_id
msgid "Branch"
msgstr ""

#. module: hr_branch
#: model:ir.model,name:hr_branch.model_hr_department
msgid "Department"
msgstr ""

#. module: hr_branch
#: model:ir.model.fields,help:hr_branch.field_hr_department__branch_id
msgid ""
"Indicate the department branch, to ensure that the employees are assigned "
"correctly"
msgstr ""
36 changes: 36 additions & 0 deletions hr_branch/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_branch
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-05-18 20:32+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\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 4.16.4\n"

#. module: hr_branch
#: model:ir.model.fields,field_description:hr_branch.field_hr_department__branch_id
msgid "Branch"
msgstr "Filiale"

#. module: hr_branch
#: model:ir.model,name:hr_branch.model_hr_department
msgid "Department"
msgstr "Ufficio"

#. module: hr_branch
#: model:ir.model.fields,help:hr_branch.field_hr_department__branch_id
msgid ""
"Indicate the department branch, to ensure that the employees are assigned "
"correctly"
msgstr ""
"Indicare la succursale dell'ufficio, per assicurare che il dipendente sia "
"assegnato correttamente"
3 changes: 3 additions & 0 deletions hr_branch/models/__init__.py
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 hr_department
14 changes: 14 additions & 0 deletions hr_branch/models/hr_department.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

branch_id = fields.Many2one(
comodel_name="res.partner",
string="Branch",
help="Indicate the department branch, to ensure that the "
"employees are assigned correctly",
)
1 change: 1 addition & 0 deletions hr_branch/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Luis Torres <[email protected]> (vauxoo.com)
5 changes: 5 additions & 0 deletions hr_branch/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module allows define the company branches, and allow indicate the
employees by each one.

To allow define the employee branch, is necessary to assign the correct
branch on the department.
Binary file added hr_branch/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.
424 changes: 424 additions & 0 deletions hr_branch/static/description/index.html

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions hr_branch/views/hr_department_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="view_department_branch_form">
<field name="name">hr.department.branch.form</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='parent_id']" position="after">
<field name="branch_id" />
</xpath>
</field>
</record>
</odoo>
13 changes: 13 additions & 0 deletions hr_branch/views/hr_employee_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="view_employee_branch_form">
<field name="name">hr.employee.branch.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='department_id']" position="attributes">
<attribute name="domain">[('branch_id', '=', address_id)]</attribute>
</xpath>
</field>
</record>
</odoo>
1 change: 1 addition & 0 deletions setup/hr_branch/odoo/addons/hr_branch
6 changes: 6 additions & 0 deletions setup/hr_branch/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)