diff --git a/hr_employee_service_contract/README.rst b/hr_employee_service_contract/README.rst new file mode 100644 index 00000000000..f0aaa90b15f --- /dev/null +++ b/hr_employee_service_contract/README.rst @@ -0,0 +1,81 @@ +================================== +HR Employee Service from Contracts +================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fhr-lightgray.png?logo=github + :target: https://github.com/OCA/hr/tree/16.0/hr_employee_service_contract + :alt: OCA/hr +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_service_contract + :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 computes employee service information based on employee's contracts. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* CorporateHub + +Contributors +~~~~~~~~~~~~ + +* `CorporateHub `__ + + * Alexey Pelykh + +* Kranokporn Th. + +* `Pesol `__: + + * Jonathan Oscategui Taza + +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/hr `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_employee_service_contract/__init__.py b/hr_employee_service_contract/__init__.py new file mode 100644 index 00000000000..4b76c7b2d5c --- /dev/null +++ b/hr_employee_service_contract/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/hr_employee_service_contract/__manifest__.py b/hr_employee_service_contract/__manifest__.py new file mode 100644 index 00000000000..6c21ed7cc76 --- /dev/null +++ b/hr_employee_service_contract/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2018 Brainbean Apps (https://brainbeanapps.com) +# Copyright 2020 CorporateHub (https://corporatehub.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "HR Employee Service from Contracts", + "version": "16.0.1.0.0", + "category": "Human Resources", + "website": "https://github.com/OCA/hr", + "author": "CorporateHub, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "application": False, + "summary": ( + "Employee service information & duration based on employee's contracts" + ), + "depends": ["hr", "hr_contract", "hr_employee_service"], + "external_dependencies": {"python": ["dateutil"]}, +} diff --git a/hr_employee_service_contract/i18n/de.po b/hr_employee_service_contract/i18n/de.po new file mode 100644 index 00000000000..9a6fd729c02 --- /dev/null +++ b/hr_employee_service_contract/i18n/de.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_service_contract +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-13 12:34+0000\n" +"Last-Translator: Maria Sparenberg \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 3.8\n" + +#. module: hr_employee_service_contract +#: model:ir.model,name:hr_employee_service_contract.model_hr_employee +msgid "Employee" +msgstr "Mitarbeiter" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First Contract" +msgstr "Erster Vertrag" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First contract of the employee" +msgstr "" +"Dies ist der Vertrag mit dem frühsten Startdatum für diesen Mitarbeiter." + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last Contract" +msgstr "Letzter Vertrag" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last contract of the employee" +msgstr "Dies ist der aktuellste Vertrag des Mitarbeiters." + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start Date" +msgstr "Startdatum" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start date is the first day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"Das Startdatum ist der Tag, an dem der Mitarbeiter das erste Mal tatsächlich " +"arbeitet. Das Datum wird auch für die Berechnung des angehäuften " +"Urlaubsanspruchs verwendet." + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination Date" +msgstr "Enddatum" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination date is the last day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"Das Enddatum ist der Tag, an dem der Mitarbeiter das letzte Mal tatsächlich " +"arbeitet. Das Datum wird auch für die Berechnung des angehäuften " +"Urlaubsanspruchs verwendet." diff --git a/hr_employee_service_contract/i18n/es.po b/hr_employee_service_contract/i18n/es.po new file mode 100644 index 00000000000..b10aec187a4 --- /dev/null +++ b/hr_employee_service_contract/i18n/es.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_service_contract +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-06-26 18:42+0000\n" +"Last-Translator: Jaime Arroyo \n" +"Language-Team: none\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" +"X-Generator: Weblate 3.6.1\n" + +#. module: hr_employee_service_contract +#: model:ir.model,name:hr_employee_service_contract.model_hr_employee +msgid "Employee" +msgstr "Empleado" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First Contract" +msgstr "Primer Contrato" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First contract of the employee" +msgstr "Primer Contrato del Empleado" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last Contract" +msgstr "Último Contrato" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last contract of the employee" +msgstr "Último Contrato del Empleado" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start Date" +msgstr "Fecha de Inicio" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start date is the first day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"La fecha de inicio es el primer día que el empleado realmente trabaja y esta " +"fecha se utiliza para el cálculo de las asignaciones de vacaciones devengadas" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination Date" +msgstr "Fecha de finalización" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination date is the last day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"La fecha de finalización es el último día que el empleado realmente trabaja " +"y esta fecha se utiliza para el cálculo de las asignaciones de vacaciones " +"devengadas" diff --git a/hr_employee_service_contract/i18n/fr.po b/hr_employee_service_contract/i18n/fr.po new file mode 100644 index 00000000000..c2c28eacb7b --- /dev/null +++ b/hr_employee_service_contract/i18n/fr.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_service_contract +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-05-23 20:19+0000\n" +"Last-Translator: Kévin Allard \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 3.6.1\n" + +#. module: hr_employee_service_contract +#: model:ir.model,name:hr_employee_service_contract.model_hr_employee +msgid "Employee" +msgstr "Employé(e)" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First Contract" +msgstr "Premier contrat" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First contract of the employee" +msgstr "Premier contrat de l'employé(e)" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last Contract" +msgstr "Dernier contrat" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last contract of the employee" +msgstr "Dernier contrat de l'employé(e)" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start Date" +msgstr "Date de début" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start date is the first day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"La date de début est le premier jour où l'employé travaille réellement et " +"cette date est utilisée pour le calcul des allocations de congés selon " +"l'exercice comptable" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination Date" +msgstr "Date de fin" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_termination_date +#, fuzzy +msgid "Termination date is the last day the employee actually works and this date is used for accrual leave allocations calculation" +msgstr "" +"La date de fin est le dernier jour où l'employé travaille réellement et " +"cette date est utilisée pour le calcul des allocations de congés accumulés" diff --git a/hr_employee_service_contract/i18n/hr_employee_service_contract.pot b/hr_employee_service_contract/i18n/hr_employee_service_contract.pot new file mode 100644 index 00000000000..082f85333a0 --- /dev/null +++ b/hr_employee_service_contract/i18n/hr_employee_service_contract.pot @@ -0,0 +1,63 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_service_contract +# +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_employee_service_contract +#: model:ir.model,name:hr_employee_service_contract.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First Contract" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__first_contract_id +msgid "First contract of the employee" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last Contract" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__last_contract_id +msgid "Last contract of the employee" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "Start Date" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_start_date +msgid "" +"Start date is the first day the employee actually works and this date is " +"used for accrual leave allocations calculation" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,field_description:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "Termination Date" +msgstr "" + +#. module: hr_employee_service_contract +#: model:ir.model.fields,help:hr_employee_service_contract.field_hr_employee__service_termination_date +msgid "" +"Termination date is the last day the employee actually works and this date " +"is used for accrual leave allocations calculation" +msgstr "" diff --git a/hr_employee_service_contract/models/__init__.py b/hr_employee_service_contract/models/__init__.py new file mode 100644 index 00000000000..7456e6897fe --- /dev/null +++ b/hr_employee_service_contract/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import hr_employee diff --git a/hr_employee_service_contract/models/hr_employee.py b/hr_employee_service_contract/models/hr_employee.py new file mode 100644 index 00000000000..9b8231edc7b --- /dev/null +++ b/hr_employee_service_contract/models/hr_employee.py @@ -0,0 +1,70 @@ +# Copyright 2018 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + first_contract_id = fields.Many2one( + "hr.contract", + compute="_compute_first_contract_id", + store=True, + prefetch=False, + string="First Contract", + help="First contract of the employee", + ) + last_contract_id = fields.Many2one( + "hr.contract", + compute="_compute_last_contract_id", + store=True, + prefetch=False, + string="Last Contract", + help="Last contract of the employee", + ) + service_start_date = fields.Date( + string="Start Date", + readonly=True, + related="first_contract_id.date_start", + prefetch=False, + ) + service_termination_date = fields.Date( + string="Termination Date", + readonly=True, + related="last_contract_id.date_end", + prefetch=False, + ) + + @api.depends("contract_ids", "contract_ids.state", "contract_ids.date_start") + def _compute_first_contract_id(self): + Contract = self.env["hr.contract"] + for employee in self: + employee.first_contract_id = Contract.search( + employee._get_contract_filter(), order="date_start asc", limit=1 + ) + + @api.depends("contract_ids", "contract_ids.state", "contract_ids.date_end") + def _compute_last_contract_id(self): + Contract = self.env["hr.contract"] + for employee in self: + employee.last_contract_id = Contract.search( + employee._get_contract_filter(), order="date_end desc", limit=1 + ) + + @api.onchange("service_hire_date") + def _onchange_service_hire_date(self): # pragma: no cover + # Do nothing + pass + + def _get_contract_filter(self): + self.ensure_one() + + return [ + ("employee_id", "=", self.id), + ("state", "in", self._get_service_contract_states()), + ] + + @api.model + def _get_service_contract_states(self): + return ["open", "pending", "close"] diff --git a/hr_employee_service_contract/readme/CONTRIBUTORS.rst b/hr_employee_service_contract/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..4b219b2c23d --- /dev/null +++ b/hr_employee_service_contract/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* `CorporateHub `__ + + * Alexey Pelykh + +* Kranokporn Th. + +* `Pesol `__: + + * Jonathan Oscategui Taza diff --git a/hr_employee_service_contract/readme/DESCRIPTION.rst b/hr_employee_service_contract/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..601a44b5f78 --- /dev/null +++ b/hr_employee_service_contract/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module computes employee service information based on employee's contracts. diff --git a/hr_employee_service_contract/static/description/icon.png b/hr_employee_service_contract/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/hr_employee_service_contract/static/description/icon.png differ diff --git a/hr_employee_service_contract/static/description/index.html b/hr_employee_service_contract/static/description/index.html new file mode 100644 index 00000000000..f60ed7caf5f --- /dev/null +++ b/hr_employee_service_contract/static/description/index.html @@ -0,0 +1,427 @@ + + + + + + +HR Employee Service from Contracts + + + +
+

HR Employee Service from Contracts

+ + +

Beta License: AGPL-3 OCA/hr Translate me on Weblate Try me on Runbot

+

This module computes employee service information based on employee’s contracts.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • CorporateHub
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/hr project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/hr_employee_service_contract/tests/__init__.py b/hr_employee_service_contract/tests/__init__.py new file mode 100644 index 00000000000..45f44105d5e --- /dev/null +++ b/hr_employee_service_contract/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_hr_employee_service diff --git a/hr_employee_service_contract/tests/test_hr_employee_service.py b/hr_employee_service_contract/tests/test_hr_employee_service.py new file mode 100644 index 00000000000..100be2207fc --- /dev/null +++ b/hr_employee_service_contract/tests/test_hr_employee_service.py @@ -0,0 +1,146 @@ +# Copyright 2018 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from dateutil.relativedelta import relativedelta + +from odoo import fields +from odoo.tests import common + + +class TestHrEmployeeService(common.TransactionCase): + def setUp(self): + super().setUp() + + self.today = fields.Date.today() + self.now = fields.Datetime.now() + self.Employee = self.env["hr.employee"] + self.SudoEmployee = self.Employee.sudo() + self.Contract = self.env["hr.contract"] + self.SudoContract = self.Contract.sudo() + + def test_1(self): + employee = self.SudoEmployee.create( + { + "name": "Employee #1", + "contract_ids": [ + ( + 0, + 0, + { + "name": "Employee #1 Contract #1", + "wage": 5000.0, + "state": "close", + "date_start": self.today - relativedelta(years=3), + "date_end": self.today - relativedelta(years=1), + }, + ) + ], + } + ) + + self.assertEqual( + employee.service_start_date, self.today - relativedelta(years=3) + ) + self.assertEqual( + employee.service_termination_date, self.today - relativedelta(years=1) + ) + + def test_2(self): + employee = self.SudoEmployee.create( + { + "name": "Employee #2", + "contract_ids": [ + ( + 0, + 0, + { + "name": "Employee #2 Contract #1", + "wage": 5000.0, + "state": "open", + "date_start": self.today - relativedelta(years=3), + }, + ) + ], + } + ) + + self.assertEqual( + employee.service_start_date, self.today - relativedelta(years=3) + ) + self.assertEqual(employee.service_termination_date, False) + + def test_3(self): + employee = self.SudoEmployee.create( + { + "name": "Employee #3", + "contract_ids": [ + ( + 0, + 0, + { + "name": "Employee #3 Contract #1", + "wage": 5000.0, + "state": "close", + "date_start": self.today - relativedelta(years=5), + "date_end": self.today - relativedelta(years=1), + }, + ), + ( + 0, + 0, + { + "name": "Employee #3 Contract #2", + "wage": 5000.0, + "state": "open", + "date_start": self.today - relativedelta(months=6), + }, + ), + ], + } + ) + + self.assertEqual( + employee.service_start_date, self.today - relativedelta(years=5) + ) + self.assertEqual(employee.service_termination_date, False) + + def test_4(self): + employee = self.SudoEmployee.create( + { + "name": "Employee #4", + "contract_ids": [ + ( + 0, + 0, + { + "name": "Employee #4 Contract #1", + "wage": 5000.0, + "state": "close", + "date_start": self.today - relativedelta(years=5), + "date_end": self.today - relativedelta(years=1), + }, + ), + ( + 0, + 0, + { + "name": "Employee #4 Contract #2", + "wage": 5000.0, + "state": "close", + "date_start": self.today - relativedelta(months=6), + }, + ), + ], + } + ) + + self.assertEqual( + employee.service_start_date, self.today - relativedelta(years=5) + ) + self.assertEqual(employee.service_termination_date, False) + + def test_5(self): + employee = self.SudoEmployee.create({"name": "Employee #5"}) + + self.assertEqual(employee.service_start_date, False) + self.assertEqual(employee.service_termination_date, False) diff --git a/setup/hr_employee_service_contract/odoo/addons/hr_employee_service_contract b/setup/hr_employee_service_contract/odoo/addons/hr_employee_service_contract new file mode 120000 index 00000000000..d8069891bd5 --- /dev/null +++ b/setup/hr_employee_service_contract/odoo/addons/hr_employee_service_contract @@ -0,0 +1 @@ +../../../../hr_employee_service_contract \ No newline at end of file diff --git a/setup/hr_employee_service_contract/setup.py b/setup/hr_employee_service_contract/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/hr_employee_service_contract/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)