diff --git a/hr_employee_age/README.rst b/hr_employee_age/README.rst index ec70827ad75..84260e2475c 100644 --- a/hr_employee_age/README.rst +++ b/hr_employee_age/README.rst @@ -17,13 +17,13 @@ Employee Age :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_age + :target: https://github.com/OCA/hr/tree/17.0/hr_employee_age :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_age + :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_age :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -38,7 +38,8 @@ Adds and computes age field on employee Usage ===== -When you add the birthday of an employee, the age of an employee will auto-populate. +When you add the birthday of an employee, the age of an employee will +auto-populate. Bug Tracker =========== @@ -46,7 +47,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -54,24 +55,27 @@ Credits ======= Authors -~~~~~~~ +------- * Salton Massally Contributors -~~~~~~~~~~~~ +------------ -* Salton Massally (iDT Labs) -* Serpent Consulting Services Pvt. Ltd. -* Saran Lim. -* Komsan Somwong +- Salton Massally (iDT Labs) +- Serpent Consulting Services Pvt. Ltd. +- Saran Lim. +- Komsan Somwong +- `Pesol `__: -* `Pesol `__: + - Pedro Evaristo Gonzalez Sanchez - * Pedro Evaristo Gonzalez Sanchez +- `Komit `__: + + - Vang Nguyen Phu Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -83,6 +87,6 @@ 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. +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_age/__manifest__.py b/hr_employee_age/__manifest__.py index cf2c24a9dc1..49179158e33 100644 --- a/hr_employee_age/__manifest__.py +++ b/hr_employee_age/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Employee Age", - "version": "16.0.1.0.1", + "version": "17.0.1.0.0", "license": "AGPL-3", "author": "Salton Massally , " "Odoo Community Association (OCA)", diff --git a/hr_employee_age/models/hr_employee.py b/hr_employee_age/models/hr_employee.py index ba2ae7e2a0c..8373ad77fbe 100644 --- a/hr_employee_age/models/hr_employee.py +++ b/hr_employee_age/models/hr_employee.py @@ -17,7 +17,4 @@ class HrEmployee(models.Model): @api.depends("birthday") def _compute_age(self): for record in self: - age = 0 - if record.birthday: - age = relativedelta(fields.Date.today(), record.birthday).years - record.age = age + record.age = record._get_age() diff --git a/hr_employee_age/pyproject.toml b/hr_employee_age/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/hr_employee_age/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_employee_age/readme/CONTRIBUTORS.md b/hr_employee_age/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..3652a0f2b32 --- /dev/null +++ b/hr_employee_age/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- Salton Massally (iDT Labs) \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Saran Lim. \<\> +- Komsan Somwong \<\> +- [Pesol](https://www.pesol.es): + - Pedro Evaristo Gonzalez Sanchez \<\> +- [Komit](https://komit-consulting.com): + - Vang Nguyen Phu diff --git a/hr_employee_age/readme/CONTRIBUTORS.rst b/hr_employee_age/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5233ce103f3..00000000000 --- a/hr_employee_age/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,8 +0,0 @@ -* Salton Massally (iDT Labs) -* Serpent Consulting Services Pvt. Ltd. -* Saran Lim. -* Komsan Somwong - -* `Pesol `__: - - * Pedro Evaristo Gonzalez Sanchez diff --git a/hr_employee_age/readme/DESCRIPTION.rst b/hr_employee_age/readme/DESCRIPTION.md similarity index 100% rename from hr_employee_age/readme/DESCRIPTION.rst rename to hr_employee_age/readme/DESCRIPTION.md diff --git a/hr_employee_age/readme/USAGE.rst b/hr_employee_age/readme/USAGE.md similarity index 75% rename from hr_employee_age/readme/USAGE.rst rename to hr_employee_age/readme/USAGE.md index e4bd276e7a9..67789e55989 100644 --- a/hr_employee_age/readme/USAGE.rst +++ b/hr_employee_age/readme/USAGE.md @@ -1 +1,2 @@ -When you add the birthday of an employee, the age of an employee will auto-populate. +When you add the birthday of an employee, the age of an employee will +auto-populate. diff --git a/hr_employee_age/static/description/index.html b/hr_employee_age/static/description/index.html index f1c9cdb5045..5b43bb1c8bf 100644 --- a/hr_employee_age/static/description/index.html +++ b/hr_employee_age/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,7 +369,7 @@

Employee Age

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:562bc7a14c6494d67ecdc257acf134c6dc0f21e46d975385817660a0906c798c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

Adds and computes age field on employee

Table of contents

@@ -386,14 +386,15 @@

Employee Age

Usage

-

When you add the birthday of an employee, the age of an employee will auto-populate.

+

When you add the birthday of an employee, the age of an employee will +auto-populate.

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -415,16 +416,22 @@

Contributors

  • Pedro Evaristo Gonzalez Sanchez <pedro.gonzalez@pesol.es>
  • +
  • Komit:
      +
    • Vang Nguyen Phu
    • +
    +
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +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.

    +

    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_age/tests/test_hr_employee.py b/hr_employee_age/tests/test_hr_employee.py index d908ea7367f..99d38894192 100644 --- a/hr_employee_age/tests/test_hr_employee.py +++ b/hr_employee_age/tests/test_hr_employee.py @@ -3,14 +3,15 @@ from dateutil.relativedelta import relativedelta from odoo import fields -from odoo.tests import common +from odoo.addons.base.tests.common import BaseCommon -class TestHrEmployee(common.TransactionCase): - def setUp(self): - super().setUp() - self.employee_admin = self.env.ref("hr.employee_admin") - self.employee_admin.write({"birthday": "1990-05-15"}) +class TestHrEmployee(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.employee_admin = cls.env.ref("hr.employee_admin") + cls.employee_admin.write({"birthday": "1990-05-15"}) def test_compute_age(self): self.employee_admin._compute_age()