From 3542976272228b699811513ac2f99bfa69a2d321 Mon Sep 17 00:00:00 2001 From: Andrea Gidalti Date: Thu, 16 Nov 2023 21:52:46 +0000 Subject: [PATCH] [IMP] hr_employee_lastnames: pre-commit stuff --- hr_employee_lastnames/README.rst | 30 ++++++++++--------- hr_employee_lastnames/models/hr_employee.py | 6 ++-- hr_employee_lastnames/pyproject.toml | 3 ++ hr_employee_lastnames/readme/CONTRIBUTORS.md | 2 ++ hr_employee_lastnames/readme/CONTRIBUTORS.rst | 2 -- hr_employee_lastnames/readme/DESCRIPTION.md | 2 ++ hr_employee_lastnames/readme/DESCRIPTION.rst | 2 -- hr_employee_lastnames/readme/USAGE.md | 4 +++ hr_employee_lastnames/readme/USAGE.rst | 2 -- .../static/description/index.html | 14 +++++---- .../tests/test_hr_employee_lastnames.py | 2 +- 11 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 hr_employee_lastnames/pyproject.toml create mode 100644 hr_employee_lastnames/readme/CONTRIBUTORS.md delete mode 100644 hr_employee_lastnames/readme/CONTRIBUTORS.rst create mode 100644 hr_employee_lastnames/readme/DESCRIPTION.md delete mode 100644 hr_employee_lastnames/readme/DESCRIPTION.rst create mode 100644 hr_employee_lastnames/readme/USAGE.md delete mode 100644 hr_employee_lastnames/readme/USAGE.rst diff --git a/hr_employee_lastnames/README.rst b/hr_employee_lastnames/README.rst index 8b38b731199a..b93a5b8762e2 100644 --- a/hr_employee_lastnames/README.rst +++ b/hr_employee_lastnames/README.rst @@ -17,19 +17,19 @@ HR Employee First Name and Two Last Names :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_lastnames + :target: https://github.com/OCA/hr/tree/17.0/hr_employee_lastnames :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_lastnames + :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_lastnames :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| -This module allows you to add firstname and lastnames (Father an Mother Last Name) in employee form, -and concatenate both in name field. +This module allows you to add firstname and lastnames (Father an Mother +Last Name) in employee form, and concatenate both in name field. **Table of contents** @@ -39,8 +39,10 @@ and concatenate both in name field. Usage ===== -#. Go to *Employees* -#. On the employee form view you will have 3 separate fields, one for Firstname, second for Lastname, both required and Mother's Last Name (optional). +1. Go to *Employees* +2. On the employee form view you will have 3 separate fields, one for + Firstname, second for Lastname, both required and Mother's Last Name + (optional). Bug Tracker =========== @@ -48,7 +50,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. @@ -56,18 +58,18 @@ Credits ======= Authors -~~~~~~~ +------- * Vauxoo Contributors -~~~~~~~~~~~~ +------------ -* Luis Escobar -* Hugo Adan +- Luis Escobar +- Hugo Adan Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -79,6 +81,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_lastnames/models/hr_employee.py b/hr_employee_lastnames/models/hr_employee.py index 7f999b08dae9..edf085ccdda7 100644 --- a/hr_employee_lastnames/models/hr_employee.py +++ b/hr_employee_lastnames/models/hr_employee.py @@ -36,7 +36,7 @@ def _get_name_lastnames(self, lastname, firstname, lastname2=None): def _prepare_vals_on_create_firstname_lastname(self, vals): values = vals.copy() - res = super(HrEmployee, self)._prepare_vals_on_create_firstname_lastname(values) + res = super()._prepare_vals_on_create_firstname_lastname(values) if any([field in vals for field in ("firstname", "lastname", "lastname2")]): vals["name"] = self._get_name_lastnames( vals.get("lastname"), vals.get("firstname"), vals.get("lastname2") @@ -50,7 +50,7 @@ def _prepare_vals_on_create_firstname_lastname(self, vals): def _prepare_vals_on_write_firstname_lastname(self, vals): values = vals.copy() - res = super(HrEmployee, self)._prepare_vals_on_write_firstname_lastname(values) + res = super()._prepare_vals_on_write_firstname_lastname(values) if any([field in vals for field in ("firstname", "lastname", "lastname2")]): if "lastname" in vals: lastname = vals["lastname"] @@ -97,7 +97,7 @@ def _get_inverse_name(self, name): return result order = self._get_names_order() - result.update(super(HrEmployee, self)._get_inverse_name(name)) + result.update(super()._get_inverse_name(name)) if order in ("first_last", "last_first_comma"): parts = self._split_part("lastname", result) diff --git a/hr_employee_lastnames/pyproject.toml b/hr_employee_lastnames/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/hr_employee_lastnames/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_employee_lastnames/readme/CONTRIBUTORS.md b/hr_employee_lastnames/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..021f9de3f901 --- /dev/null +++ b/hr_employee_lastnames/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Luis Escobar \<\> +- Hugo Adan \<\> diff --git a/hr_employee_lastnames/readme/CONTRIBUTORS.rst b/hr_employee_lastnames/readme/CONTRIBUTORS.rst deleted file mode 100644 index 03ab0b41c7da..000000000000 --- a/hr_employee_lastnames/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Luis Escobar -* Hugo Adan diff --git a/hr_employee_lastnames/readme/DESCRIPTION.md b/hr_employee_lastnames/readme/DESCRIPTION.md new file mode 100644 index 000000000000..f8b51331199f --- /dev/null +++ b/hr_employee_lastnames/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows you to add firstname and lastnames (Father an Mother +Last Name) in employee form, and concatenate both in name field. diff --git a/hr_employee_lastnames/readme/DESCRIPTION.rst b/hr_employee_lastnames/readme/DESCRIPTION.rst deleted file mode 100644 index ef50535cd9a2..000000000000 --- a/hr_employee_lastnames/readme/DESCRIPTION.rst +++ /dev/null @@ -1,2 +0,0 @@ -This module allows you to add firstname and lastnames (Father an Mother Last Name) in employee form, -and concatenate both in name field. diff --git a/hr_employee_lastnames/readme/USAGE.md b/hr_employee_lastnames/readme/USAGE.md new file mode 100644 index 000000000000..4f2fb890ecc4 --- /dev/null +++ b/hr_employee_lastnames/readme/USAGE.md @@ -0,0 +1,4 @@ +1. Go to *Employees* +2. On the employee form view you will have 3 separate fields, one for + Firstname, second for Lastname, both required and Mother's Last Name + (optional). diff --git a/hr_employee_lastnames/readme/USAGE.rst b/hr_employee_lastnames/readme/USAGE.rst deleted file mode 100644 index 1c82d5662e4f..000000000000 --- a/hr_employee_lastnames/readme/USAGE.rst +++ /dev/null @@ -1,2 +0,0 @@ -#. Go to *Employees* -#. On the employee form view you will have 3 separate fields, one for Firstname, second for Lastname, both required and Mother's Last Name (optional). diff --git a/hr_employee_lastnames/static/description/index.html b/hr_employee_lastnames/static/description/index.html index a24377862e9b..f651d14c79fb 100644 --- a/hr_employee_lastnames/static/description/index.html +++ b/hr_employee_lastnames/static/description/index.html @@ -369,9 +369,9 @@

HR Employee First Name and Two Last Names

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:e4f0e057a11708fb06d7fb285b5437c765e637981b18e15a0fa1ae34770e1834 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module allows you to add firstname and lastnames (Father an Mother Last Name) in employee form, -and concatenate both in name field.

+

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

+

This module allows you to add firstname and lastnames (Father an Mother +Last Name) in employee form, and concatenate both in name field.

Table of contents

    @@ -389,7 +389,9 @@

    HR Employee First Name and Two Last Names

    Usage

    1. Go to Employees
    2. -
    3. On the employee form view you will have 3 separate fields, one for Firstname, second for Lastname, both required and Mother’s Last Name (optional).
    4. +
    5. On the employee form view you will have 3 separate fields, one for +Firstname, second for Lastname, both required and Mother’s Last Name +(optional).
@@ -397,7 +399,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.

@@ -422,7 +424,7 @@

Maintainers

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_lastnames/tests/test_hr_employee_lastnames.py b/hr_employee_lastnames/tests/test_hr_employee_lastnames.py index 2cb1d515de66..ccdfb146ded6 100644 --- a/hr_employee_lastnames/tests/test_hr_employee_lastnames.py +++ b/hr_employee_lastnames/tests/test_hr_employee_lastnames.py @@ -4,7 +4,7 @@ class TestEmployeeLastnames(TransactionCase): def setUp(self): - super(TestEmployeeLastnames, self).setUp() + super().setUp() self.env["ir.config_parameter"].sudo().set_param( "employee_names_order", "first_last" )