From 429506ca88983ed1472f9028adc5bc7c607d0430 Mon Sep 17 00:00:00 2001 From: Andrea Gidalti Date: Thu, 21 Dec 2023 17:29:24 +0000 Subject: [PATCH 1/8] [MOV] hr_employee_second_lastname: rename module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Module is renamed from hr_employee_lastnames → hr_employee_second_lastname in order to be consistent with partner_second_lastname module. --- hr_employee_second_lastname/README.rst | 92 ++++ hr_employee_second_lastname/__init__.py | 2 + hr_employee_second_lastname/__manifest__.py | 17 + hr_employee_second_lastname/hooks.py | 29 ++ hr_employee_second_lastname/i18n/ca.po | 51 +++ hr_employee_second_lastname/i18n/es.po | 61 +++ hr_employee_second_lastname/i18n/hr.po | 47 ++ .../i18n/hr_employee_lastnames.pot | 45 ++ hr_employee_second_lastname/i18n/it.po | 48 ++ hr_employee_second_lastname/i18n/pt_BR.po | 57 +++ .../models/__init__.py | 2 + .../models/hr_employee.py | 160 +++++++ .../models/hr_employee_base.py | 9 + .../readme/CONTRIBUTORS.rst | 2 + .../readme/DESCRIPTION.rst | 2 + hr_employee_second_lastname/readme/USAGE.rst | 2 + .../static/description/icon.png | Bin 0 -> 5938 bytes .../static/description/index.html | 432 ++++++++++++++++++ hr_employee_second_lastname/tests/__init__.py | 3 + .../tests/test_hr_employee_second_lastname.py | 163 +++++++ .../views/hr_views.xml | 15 + 21 files changed, 1239 insertions(+) create mode 100644 hr_employee_second_lastname/README.rst create mode 100644 hr_employee_second_lastname/__init__.py create mode 100644 hr_employee_second_lastname/__manifest__.py create mode 100644 hr_employee_second_lastname/hooks.py create mode 100644 hr_employee_second_lastname/i18n/ca.po create mode 100644 hr_employee_second_lastname/i18n/es.po create mode 100644 hr_employee_second_lastname/i18n/hr.po create mode 100644 hr_employee_second_lastname/i18n/hr_employee_lastnames.pot create mode 100644 hr_employee_second_lastname/i18n/it.po create mode 100644 hr_employee_second_lastname/i18n/pt_BR.po create mode 100644 hr_employee_second_lastname/models/__init__.py create mode 100644 hr_employee_second_lastname/models/hr_employee.py create mode 100644 hr_employee_second_lastname/models/hr_employee_base.py create mode 100644 hr_employee_second_lastname/readme/CONTRIBUTORS.rst create mode 100644 hr_employee_second_lastname/readme/DESCRIPTION.rst create mode 100644 hr_employee_second_lastname/readme/USAGE.rst create mode 100644 hr_employee_second_lastname/static/description/icon.png create mode 100644 hr_employee_second_lastname/static/description/index.html create mode 100644 hr_employee_second_lastname/tests/__init__.py create mode 100644 hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py create mode 100644 hr_employee_second_lastname/views/hr_views.xml diff --git a/hr_employee_second_lastname/README.rst b/hr_employee_second_lastname/README.rst new file mode 100644 index 00000000000..a12564e5fbd --- /dev/null +++ b/hr_employee_second_lastname/README.rst @@ -0,0 +1,92 @@ +========================================= +HR Employee First Name and Two Last Names +========================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e3ad9ca8445db84cea2f6b86336a239e2277e208c08820c7e4ea30ad9d259fe8 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/hr_employee_second_lastname + :alt: OCA/hr +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_second_lastname + :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=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. + +**Table of contents** + +.. contents:: + :local: + +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). + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Vauxoo + +Contributors +~~~~~~~~~~~~ + +* Luis Escobar +* Hugo Adan + +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-luisg123v| image:: https://github.com/luisg123v.png?size=40px + :target: https://github.com/luisg123v + :alt: luisg123v + +Current `maintainer `__: + +|maintainer-luisg123v| + +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_second_lastname/__init__.py b/hr_employee_second_lastname/__init__.py new file mode 100644 index 00000000000..cc6b6354ad8 --- /dev/null +++ b/hr_employee_second_lastname/__init__.py @@ -0,0 +1,2 @@ +from . import models +from .hooks import post_init_hook diff --git a/hr_employee_second_lastname/__manifest__.py b/hr_employee_second_lastname/__manifest__.py new file mode 100644 index 00000000000..b6216e521b9 --- /dev/null +++ b/hr_employee_second_lastname/__manifest__.py @@ -0,0 +1,17 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "HR Employee First Name and Two Last Names", + "version": "16.0.1.0.2", + "author": "Vauxoo, Odoo Community Association (OCA)", + "maintainers": ["luisg123v"], + "website": "https://github.com/OCA/hr", + "license": "AGPL-3", + "category": "Human Resources", + "summary": "Split Name in First Name, Father's Last Name and Mother's Last Name", + "depends": ["hr_employee_firstname"], + "data": ["views/hr_views.xml"], + "post_init_hook": "post_init_hook", + "demo": [], + "test": [], + "installable": True, +} diff --git a/hr_employee_second_lastname/hooks.py b/hr_employee_second_lastname/hooks.py new file mode 100644 index 00000000000..7026e3e6aaa --- /dev/null +++ b/hr_employee_second_lastname/hooks.py @@ -0,0 +1,29 @@ +from odoo import SUPERUSER_ID +from odoo.api import Environment + + +def post_init_hook(cr, _): + # This SQL statement is necessary to call _install_employee_lastnames() and + # set name fields correctly. + # + # After the installation, previously the dependency hr_employee_firstname + # splitting the name into two parts: firstname and lastname, so for this + # module to be able to process the new field lastmane2 it is necessary to + # reset the values to empty to be able to correctly set the three fields + # (firstname, lastname and lastname2). + # + # For example: + # After install hr_employee_fisrtname and before install hr_employee_second_lastname: + # name = 'John Peterson Clinton' + # firstname = 'John' + # lastname = 'Peterson Clinton' + # + # After install hr_employee_second_lastname: + # name = 'John Peterson Clinton' + # firstname = 'John' + # lastname = 'Peterson' + # lastname2 = 'Clinton' + cr.execute("UPDATE hr_employee SET firstname = NULL, lastname = NULL") + env = Environment(cr, SUPERUSER_ID, {}) + env["hr.employee"]._install_employee_lastnames() + env["ir.config_parameter"].sudo().set_param("employee_names_order", "first_last") diff --git a/hr_employee_second_lastname/i18n/ca.po b/hr_employee_second_lastname/i18n/ca.po new file mode 100644 index 00000000000..87be4c737aa --- /dev/null +++ b/hr_employee_second_lastname/i18n/ca.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-11 13:47+0000\n" +"Last-Translator: Haftec \n" +"Language-Team: none\n" +"Language: ca\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_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "Empleat" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "Nom" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "Primer cognom" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "Segon cognom" + +#~ msgid "Last Modified on" +#~ msgstr "Darrera modificació el" diff --git a/hr_employee_second_lastname/i18n/es.po b/hr_employee_second_lastname/i18n/es.po new file mode 100644 index 00000000000..d6c2a012554 --- /dev/null +++ b/hr_employee_second_lastname/i18n/es.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-31 12:31+0000\n" +"PO-Revision-Date: 2023-08-03 21:10+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \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 4.17\n" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "Empleado Básico" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "Empleado" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "Nombre Propio" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "Primer Apellido" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "Segundo Apellido" + +#~ msgid "Display Name" +#~ msgstr "Mostrar nombre" + +#~ msgid "ID" +#~ msgstr "ID (identificación)" + +#~ msgid "Last Modified on" +#~ msgstr "Modificado por última vez el" + +#~ msgid "No name set." +#~ msgstr "Sin nombre establecido." diff --git a/hr_employee_second_lastname/i18n/hr.po b/hr_employee_second_lastname/i18n/hr.po new file mode 100644 index 00000000000..75110d71462 --- /dev/null +++ b/hr_employee_second_lastname/i18n/hr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "" diff --git a/hr_employee_second_lastname/i18n/hr_employee_lastnames.pot b/hr_employee_second_lastname/i18n/hr_employee_lastnames.pot new file mode 100644 index 00000000000..2efbb4ca4d9 --- /dev/null +++ b/hr_employee_second_lastname/i18n/hr_employee_lastnames.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +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_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "" diff --git a/hr_employee_second_lastname/i18n/it.po b/hr_employee_second_lastname/i18n/it.po new file mode 100644 index 00000000000..159b730d204 --- /dev/null +++ b/hr_employee_second_lastname/i18n/it.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-05-17 14:35+0000\n" +"Last-Translator: mymage \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.14.1\n" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "Dipendente base" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "Dipendente" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "Nome" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "Cognome" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "Secondo cognome" diff --git a/hr_employee_second_lastname/i18n/pt_BR.po b/hr_employee_second_lastname/i18n/pt_BR.po new file mode 100644 index 00000000000..d28bef9e7dd --- /dev/null +++ b/hr_employee_second_lastname/i18n/pt_BR.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_lastnames +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-09-26 16:07+0000\n" +"Last-Translator: Douglas Custódio \n" +"Language-Team: none\n" +"Language: pt_BR\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_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +msgid "Basic Employee" +msgstr "Funcionário Basico" + +#. module: hr_employee_lastnames +#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +msgid "Employee" +msgstr "Funcionário" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +msgid "First name" +msgstr "Nome" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +msgid "Last name" +msgstr "Sobrenome" + +#. module: hr_employee_lastnames +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "Segundo sobrenome" + +#~ msgid "Display Name" +#~ msgstr "Nome de Exibição" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificação em" diff --git a/hr_employee_second_lastname/models/__init__.py b/hr_employee_second_lastname/models/__init__.py new file mode 100644 index 00000000000..f55d18fa465 --- /dev/null +++ b/hr_employee_second_lastname/models/__init__.py @@ -0,0 +1,2 @@ +from . import hr_employee_base +from . import hr_employee diff --git a/hr_employee_second_lastname/models/hr_employee.py b/hr_employee_second_lastname/models/hr_employee.py new file mode 100644 index 00000000000..7f999b08dae --- /dev/null +++ b/hr_employee_second_lastname/models/hr_employee.py @@ -0,0 +1,160 @@ +import logging + +from odoo import api, models + +from odoo.addons.hr_employee_firstname.models.hr_employee import UPDATE_PARTNER_FIELDS + +_logger = logging.getLogger(__name__) + +UPDATE_PARTNER_FIELDS += ["lastname2"] + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + @api.model + def _get_name_lastnames(self, lastname, firstname, lastname2=None): + order = self._get_names_order() + names = list() + if order == "first_last": + if firstname: + names.append(firstname) + if lastname: + names.append(lastname) + if lastname2: + names.append(lastname2) + else: + if lastname: + names.append(lastname) + if lastname2: + names.append(lastname2) + if names and firstname and order == "last_first_comma": + names[-1] = names[-1] + "," + if firstname: + names.append(firstname) + return " ".join(names) + + def _prepare_vals_on_create_firstname_lastname(self, vals): + values = vals.copy() + res = super(HrEmployee, self)._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") + ) + elif vals.get("name"): + name_splitted = self.split_name(vals["name"]) + vals["firstname"] = name_splitted["firstname"] + vals["lastname"] = name_splitted["lastname"] + vals["lastname2"] = name_splitted["lastname2"] + return res + + def _prepare_vals_on_write_firstname_lastname(self, vals): + values = vals.copy() + res = super(HrEmployee, self)._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"] + else: + lastname = self.lastname + if "firstname" in vals: + firstname = vals["firstname"] + else: + firstname = self.firstname + if "lastname2" in vals: + lastname2 = vals["lastname2"] + else: + lastname2 = self.lastname2 + vals["name"] = self._get_name_lastnames(lastname, firstname, lastname2) + elif vals.get("name"): + name_splitted = self.split_name(vals["name"]) + vals["lastname"] = name_splitted["lastname"] + vals["firstname"] = name_splitted["firstname"] + vals["lastname2"] = name_splitted["lastname2"] + return res + + def _update_partner_firstname(self): + for employee in self: + partners = employee.mapped("user_id.partner_id") + partners |= employee.mapped("address_home_id") + partners.write( + { + "firstname": employee.firstname, + "lastname": employee.lastname, + "lastname2": employee.lastname2, + } + ) + + @api.model + def _get_inverse_name(self, name): + """Compute the inverted name.""" + result = { + "firstname": False, + "lastname": name or False, + "lastname2": False, + } + + if not name: + return result + + order = self._get_names_order() + result.update(super(HrEmployee, self)._get_inverse_name(name)) + + if order in ("first_last", "last_first_comma"): + parts = self._split_part("lastname", result) + if parts: + result.update({"lastname": parts[0], "lastname2": " ".join(parts[1:])}) + else: + parts = self._split_part("firstname", result) + if parts: + result.update( + {"firstname": parts[-1], "lastname2": " ".join(parts[:-1])} + ) + return result + + def _split_part(self, name_part, name_split): + """Split a given part of a name. + + :param name_split: The parts of the name + :type dict + + :param name_part: The part to split + :type str + """ + name = name_split.get(name_part, False) + parts = name.split(" ", 1) if name else [] + if not name or len(parts) < 2: + return False + return parts + + def _inverse_name(self): + """Try to revert the effect of :method:`._compute_name`.""" + for record in self: + parts = self._get_inverse_name(record.name) + record.write( + { + "lastname": parts["lastname"], + "firstname": parts["firstname"], + "lastname2": parts["lastname2"], + } + ) + + @api.model + def _install_employee_lastnames(self): + """Save names correctly in the database. + Before installing the module, field ``name`` contains all full names. + When installing it, this method parses those names and saves them + correctly into the database. This can be called later too if needed. + """ + # Find records with empty firstname and lastnames + records = self.search([("firstname", "=", False), ("lastname", "=", False)]) + + # Force calculations there + records._inverse_name() + _logger.info("%d employees updated installing module.", len(records)) + + @api.onchange("firstname", "lastname", "lastname2") + def _onchange_firstname_lastname(self): + if self.firstname or self.lastname or self.lastname2: + self.name = self._get_name_lastnames( + self.lastname, self.firstname, self.lastname2 + ) diff --git a/hr_employee_second_lastname/models/hr_employee_base.py b/hr_employee_second_lastname/models/hr_employee_base.py new file mode 100644 index 00000000000..7f630b2e991 --- /dev/null +++ b/hr_employee_second_lastname/models/hr_employee_base.py @@ -0,0 +1,9 @@ +from odoo import fields, models + + +class HrEmployeeBase(models.AbstractModel): + _inherit = "hr.employee.base" + + firstname = fields.Char("First name") + lastname = fields.Char("Last name") + lastname2 = fields.Char("Second last name") diff --git a/hr_employee_second_lastname/readme/CONTRIBUTORS.rst b/hr_employee_second_lastname/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..03ab0b41c7d --- /dev/null +++ b/hr_employee_second_lastname/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Luis Escobar +* Hugo Adan diff --git a/hr_employee_second_lastname/readme/DESCRIPTION.rst b/hr_employee_second_lastname/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..ef50535cd9a --- /dev/null +++ b/hr_employee_second_lastname/readme/DESCRIPTION.rst @@ -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_second_lastname/readme/USAGE.rst b/hr_employee_second_lastname/readme/USAGE.rst new file mode 100644 index 00000000000..1c82d5662e4 --- /dev/null +++ b/hr_employee_second_lastname/readme/USAGE.rst @@ -0,0 +1,2 @@ +#. 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_second_lastname/static/description/icon.png b/hr_employee_second_lastname/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..297dc71c85c5fdd8deafabfbb46093e04adc32d1 GIT binary patch literal 5938 zcmZ{oWmFXI^Y&S~Q@W%NlQZ+2a^I50RaI=RYgJPA7%a%I_ke%>+HSx52!Zk$_fat|3z_c zRp!46hL?)5??0;iPfBC1QvVhGy<{E#QRaU-zJ^;NAdm>DD#+>uuAb#%d@$Y59w{n} zV@#J(iOk|Fp-kV&k~3Y^QH$!(b+Vq~dGD0q{}wxo1QD4Ps4`oh%BjA|XuNqJw)KbU zmpavmsg3xhhiZr2#20(@&3p63$LZ&9j3cTAh>i|#FLw%kr!zU3W-neY9@ut3l-qwa z#k^E@g@A`1VZjown>hzQ!q3=j>*ndcspz`~cX97qSv}6)AC;AA@7E#4tV-J2{*Hha z)r3^~l!T6WtKR|f=s>a~gDr;nr)*aNd2P!8qI( zt@@jCF0-niv+}!9!YT1ys6a}j=R&qeYbXcKL^aareQJmn zt*AYTL#Hk6JWoOVVwM}p9j|>vl2v zj7Z~drXXFMN6y3u55X24pj*p`8-1JyGw}9{MVh`$Q-YlcgP-2c-JsjrQ)%X@)XvO@ z=k4sM?J(iU9B-bGdb!sT%9-m;cSwJTIJO04K4;Lnu;VPXfzl;APGBN?`uau zFkV!VR*dwmL?ErsR?bk?9`nuF7V?~OXX*8}I~2qCMDF*XHJ2^Q0LxR#F0Rx-16x}7 zrl(JH)ci$U1p^>-{%jjblml7BX5LQ{6?Y49E(!=q_B=mN_JK!n*)60X9WiQqjW8wO zYIr1H6nWkMEz9hl-kqY6q8tU;RfYUW#50W0)IZ*I{>lJn!-2ON4kY+S|Nh(btN8>K zTT~lIq>lhN+io33zP>sIqeOVh%@+>PqqkJwmi9A5P8eY<6bRGN6Qj)kEUF^?2ns|A zP3h&5e~6va3P7pxj2+Ixk$R?q&CEZPQuFM0l9bV$@N#TMk}Tbpk=mtB>xDG-O%b!e zYzbH1bxCt%puMC2GxuqsJ%x;%dISo8Gqu1Cg`O@@{p_qTPpl{< zeDaj45+mFt7&TLupXUybfnON!h*z0Mcm;O?`|AN2+>IiXkL`({iifllvn`{Jm*P7r zlSW;w&As=U4xX9jcB9Yv039!}$VIoAMA+6PPEyU7w64QB?=1#ovL4cgcmv-P_{Chw z!zaa7E@x~lp(j|A^@z&xsSqjRg=O1U6wL7zmxo1k@Vy2UW^Avzde}V8+MlGp9AF+f z0Rqj5ax4jphrs)eso&^-DU5LFn6rA5MIyI>Drp@ADy$|&nx)_d_AR7NFL9*Aj7oG3NP0|VI56V*}{W^Wf{5J-YzPdN2q?|xmA zsk@KSYus~jc99UiJKxP>g z%DspUswDVwmoo+^SQrI--$oaD-vGI9x}QH?yWhMUiU`Y4*ZhlEMazQcc@9bl6^xP| z3=XnGyuIpT{`9#OyCCkby-S)|Lq|q&2>PlOg-lM1C69Ry0RbHi5%&Wl(yN}F?H)n`2P-ku&c=zd$9!LW4NYN2Epl;`I2A7=3K zuD^~nk5=kIysqBUC?NCicen&XU-q`CND1olLX&>IQfMxJo~bxweKz&!4<;O0IiPDC z(c&IA+2Zhs(w|8{ocvjAMcz)DB_#f|Q~fl=t}X{o11%jjQg8yZ$Y~NJG_12+(OA+{Ch_mT3)Khztx5KNKpKMdkAsp zLoxcfML!UHr?Cuf1s4&WxWhT4aM3fuWR6cD<%^}Yl>ih)CY9f#a#kwHQc`;Yug8?0 zhwJ^jVCmI?MwH(9^mv+jq>kB?L1f!E&DrEh5zaKGRBeEP=s0 z#)u(zx>PVq(^$7dC%jjdAQ=S(6aSZ3HTm8GOv;l(>`<$k)#r)ojj;Areb^LP=i_O66LcI5y&&S61ekY64ujGX=`PACSDE^AW-yHKS zs<+nT7Zom)k2S@&IIHvLEbSP1wV?Dhb-99?dS6WGT z6{_MA36iAL62-5{D@kPUanwfv8o9a`Kh41AqtZKx0k1G~P@+Qgc=Ykaz{oHQy%cW} z2YDX=ynH?LlC;&=%ztplX&SJq_oD0!V?5j;BD7eljt&CT?}2)YIrU9n$>$xKfyf)n zvvfv8`fg0mJx~On^eZY9Mi#%*KjNRgK z$QPC#Y>7%cwr$%Osi`6-r^8pFiuqZ04(d0fN18f)5&CywZVSE`V9`B@arZC~eviB& zY>dn}`>hXD+L|tGR?%@p;bNNY;c})R{}K1r#o=tw_8`(BAIS*Q2|8`GZ~mJcncNN7k9~ak6xJDMfH)>{V0ey?;cF|)J}~m8+H(h+sfs0zEd`G36aMG&&&{{ z)*0;VD2FG?D;KhDm2tE6zxg(h6QfBF-^&sxudHO?XQxzjOx89v0C@fm3|@snmgRNy8ZslFjqG)7c*Zl?^NlZl&D^) z)&5-@Kt%_)whnMS8n_A&Z6}AtDdE&onjCGaNxMStO~8PZySlNnp!h?2G+a#v%fSI`uzq+XOS#eZUT$DbI~ zMvkSo6!bZ=D3o-In$vl`NZR?^+6=*KO_xckcKgJ}>pd|A zcvLx}$rbAKQ9Xk{0^#+g9|Fh3dE`R6_Nd}qg!gMRbZp)`rEp-LLJm*nMGWf*&;8Nn z1zhWoGm)~&r6`TbCE5&pVn07fQHE1wQ3yZ^D@ME>4WCYvSTKZe+f&r^Eb50=W_?H5 zSqI1Jsm9MfL~F>ZnV@276v+a^kZ#O31X5D1KK-<=yZ=cD|KU2Y#_cbmEUs`wV0h&4 z?j@%x+UQ`K4N=|*2>(&#sj{HD+Lfz=U7X_p@b@3N>Ut{GX-=jfem4eKz~L+pXLrf} z`rsbj>asT3IIE*xzO^7YcYTu=9POy#R2mnrn2_0qe82ffeY$*U4(bY;d2GiR*48wS zCRX$BD%b0jTiaAEvev@4wR1D8)_*^v4)aCq`3g4ul29bfy)73*@m<8(3I4dMk870^ zOTUBub#(4t7Bjm5KJTUuj7ctDtzo*uv~YA!5#2Ux(D52T@sR-%>26{E%5tEjjA<+p z?pdzxL)L5yZ95Ze*fa7h!tc46<$8iDYyN2&36JWfrB$@|lXU-#B#?lOo_bNWPE%en zL6hVUAFJCYwK7KirikQvQj}$;Amc{DxCw4()aiGh5Q{XoAhewNnjAYici|DN?PTOO z?q+P?fB^Q%r4DU2?$be!KwWnE9flc!Iu==Xk`2;olEaDd>=^3AfVm+XboyaB6A%|- zk~*SnhF&xD+%D22zPykk2ht3F{liy+${T2qm7t{LZdv{wy-E{1Jg?FK5FQ>Bh$ZQu z*aK<>l#Km_B~8Uk2#^y7X|ah~T?)tFs{+=5y=g*8Cee128K$_)xP@C40#PL`TMuKxG>s=e?0cH9$1Z6|#?W!X5 zmOm;T8jQCgrZi;EY7?Rgm4l-pEY?P&c5JBMt^Ru zM!7I|hWX#wc8Xd{hcdog$PIBUTHg**OM5h{q2zJtjwsW(((D8I&Y}HO-`tzs2veq| zuq+Yplcr)NI8bQ93F=WuKId|OMq11ayNeMp#3XJBh-APau|yFh`%UjsuikPAiRF~31QxsuVk$aGJk=B{l#`&((dkxazq`$b)qmuO^K1jR z*;mJ$1A%9d?>cqm=cU>Ua&vmfKwCNiQlFBV$@qg%=Db>V=TY+En^Pt@O0*+%65|ws z`S86U;;wJQHo*}L^V3evva?E0O!fEZF?8YzCPpb?8hewqWy1NJLX1dk)mdUuKxRn?v#<-f>!8i4iCrm# zQ?$H;N^;}*BN8rF(Bkp3^ZZe=SS;f{#x~{y$82#Rh)wR({A`6Dl;+JC+mijuYrx2^ zawsv?1Z~D-QF{hLz!r@BB2fVOXCYxN=L!C=K3Tf01?;|!J~X4922(3;?C)sJzDn}< z2wgZxJY-PsDqK`^>aJDSV$W{$-Y$w@dt$NtIx8pyE1?CeBfGapDJk*0TuCc?sfL^j zrx(M`*HVlp@0Q7cl)A}_*NYIu1LW}<;7z>pIyA+ HxC&%52rYWz659b%5VwO|`_ zaaQ#=6u&oY2zu6@mqcZA?3^$LLA1@GkSu(6^PPQWZZY;7F6YC8a_lpM(DkSGftGO% z_um`BHhClkx;H`JSk~Ttd5GY({L&1e?@ro;X?i4Ydl);F;wRVRx9Bn&kc!o)Sl~z_ z5CQ#86V0KQ-(9hBGUwud@rXduz%Mk|H{?8!wKzZ-O|LnpQ?+E;o^A!~V>^k6D6xnd zIH(qQ2<1O5{oVuI+Z|4ljOkl$8fWCQoRVkuv)in~o164Wzg-7S+U)G*09}+29bg-k z6|fFK0<%QNWb+Fb+3iD13oqZpvlsX3_mojiiInYFH`6Hf7)O~;ahL_4ubvp9`%UGp z$4M(6d~&)2-lA0-nLOpnwZuxjB`(iIufhdS;V%yiTBR5ca;J7Iwk%4mY5;+dFI7V; zz7^=|Q!NMo{@GM4@(t6Bw4yNg>M1as7 z(YKyLW4AaK(X=h#HMD}7BWG+}9EgNBfcL11b-Jw{g-ZnBAypD%V{C=a_RP9+%&mXv zYA!=`cuYK?S`G+ECwenaSJ^Yf?T3E1pL`42z?_cH$B1^Uy`R%FUR#geTc;oQU4v5O zDWGtLejeaw9f<(a^=oi+1*;)Np4onst25!+{sHy+FbRRd zPn{b1<`{#;i4{Pd-v>#1N^|3=j~2yNm1MJzAOMP%14VIuUuBixf~dO?jso!wj36qN#&u}7i( z(&mmB*QfBxJUKMh_Wbz~@Oh@10!Aik%d(Qjwj{icpZ#2S^1pDcuy{pM!1qsjWuJci zcS>gZplI~L&iaGBn5~cfKOpe&@Q8B$d%XO5yaHmp{9-&j>^yw`@*g!m+W*Jk?rG=j z5cK~yWRfPA{WFmNH$m6a;X{D6k3B*_KmeDshpVrxwU<4Yr;lU)xdg?(CInSQ4TVNI HtLXm&e3x`` literal 0 HcmV?d00001 diff --git a/hr_employee_second_lastname/static/description/index.html b/hr_employee_second_lastname/static/description/index.html new file mode 100644 index 00000000000..c06dae539d3 --- /dev/null +++ b/hr_employee_second_lastname/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +HR Employee First Name and Two Last Names + + + +
+

HR Employee First Name and Two Last Names

+ + +

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

+ +
+

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. +
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Vauxoo
  • +
+
+
+

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.

+

Current maintainer:

+

luisg123v

+

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_second_lastname/tests/__init__.py b/hr_employee_second_lastname/tests/__init__.py new file mode 100644 index 00000000000..c440b5ff6c1 --- /dev/null +++ b/hr_employee_second_lastname/tests/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import test_hr_employee_second_lastname diff --git a/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py new file mode 100644 index 00000000000..4ab6f2ad5fe --- /dev/null +++ b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py @@ -0,0 +1,163 @@ +from odoo import exceptions +from odoo.tests.common import TransactionCase + + +class TestEmployeeSecondLastname(TransactionCase): + def setUp(self): + super(TestEmployeeSecondLastname, self).setUp() + self.env["ir.config_parameter"].sudo().set_param( + "employee_names_order", "first_last" + ) + self.employee_model = self.env["hr.employee"] + + # Create 3 employees to concatenate the firstname and lastnames + # in name_related + self.employee1_id = self.employee_model.create( + {"firstname": "Manuel", "lastname": "Fernandez", "lastname2": "Gonzalez"} + ) + self.employee2_id = self.employee_model.create( + {"firstname": "Jean-Pierre", "lastname": "Carnaud"} + ) + self.employee3_id = self.employee_model.create( + {"firstname": "Jenssens", "lastname": "Famke"} + ) + + # Create 3 employees for split the name_related to + # firstname and lastnames + self.employee10_id = self.employee_model.create( + {"name": "Manuel Fernandez Gonzalez"} + ) + self.employee20_id = self.employee_model.create({"name": "Jean-Pierre Carnaud"}) + self.employee30_id = self.employee_model.create({"name": "JenssensFamke"}) + + def test_get_name_lastnames(self): + """Validate the _get_name_lastnames method is concatenating + the firstname and lastnames + """ + # Check for employee1 + self.assertEqual(self.employee1_id.name, "Manuel Fernandez Gonzalez") + + # Check for employee2 + self.assertEqual(self.employee2_id.name, "Jean-Pierre Carnaud") + + # Check for employee3 + self.assertEqual(self.employee3_id.name, "Jenssens Famke") + + def test_onchange(self): + """Validate the _get_name_lastnames method is not failing""" + field_onchange = self.employee_model.new({})._onchange_spec() + self.assertEqual(field_onchange.get("firstname"), "1") + self.assertEqual(field_onchange.get("lastname"), "1") + values = { + "firstname": "Pedro", + "lastname": "Perez", + "lastname2": "Hernandez", + "name": "test employee", + } + for field in self.employee_model._fields: + if field not in values: + values[field] = False + # we work on a temporary record + new_record = self.employee_model.new(values) + + updates = new_record.onchange( + values, ["firstname", "lastname", "lastname2"], field_onchange + ) + values.update(updates.get("value", {})) + self.assertEqual(values["name"], "Pedro Perez Hernandez") + + def test_auto_init_name(self): + """Validate the create method if the name is split + in firstname and lastnames + """ + # Check for employee10 + self.assertEqual(self.employee10_id.firstname, "Manuel") + self.assertEqual(self.employee10_id.lastname, "Fernandez") + self.assertEqual(self.employee10_id.lastname2, "Gonzalez") + + # Check for employee20 + self.assertEqual(self.employee20_id.firstname, "Jean-Pierre") + self.assertEqual(self.employee20_id.lastname, "Carnaud") + self.assertEqual(self.employee20_id.lastname2, False) + + # Check for employee30 + self.assertEqual(self.employee30_id.firstname, False) + self.assertEqual(self.employee30_id.lastname, "JenssensFamke") + self.assertEqual(self.employee30_id.lastname2, False) + + employee_without_name = self.employee_model + with self.assertRaises(exceptions.ValidationError): + employee_without_name = self.employee_model.create( + {"firstname": "", "lastname": ""} + ) + self.assertEqual(employee_without_name, self.employee_model) + + def test_change_name(self): + self.employee1_id.write({"name": "Pedro Martinez Torres"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.firstname, "Pedro") + self.assertEqual(self.employee1_id.lastname, "Martinez") + self.assertEqual(self.employee1_id.lastname2, "Torres") + + def test_change_name_with_space(self): + self.employee1_id.write({"name": " Jean-Pierre Carnaud-Eyck"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.firstname, "Jean-Pierre") + self.assertEqual(self.employee1_id.lastname, "Carnaud-Eyck") + self.assertEqual(self.employee1_id.lastname2, False) + + def test_change_firstname(self): + self.employee1_id.write({"firstname": "Pedro"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.name, "Pedro Fernandez Gonzalez") + + def test_change_lastname(self): + self.employee1_id.write({"lastname": "Lopez"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.name, "Manuel Lopez Gonzalez") + + def test_change_firstname_and_lastnames(self): + self.employee1_id.write({"firstname": "Jean-Pierre", "lastname2": "Carnaud"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.name, "Jean-Pierre Fernandez Carnaud") + + def test_change_lastname_with_set_last_first(self): + self.env["ir.config_parameter"].sudo().set_param( + "employee_names_order", "last_first" + ) + self.employee1_id.write({"lastname": "Lopez"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.name, "Lopez Gonzalez Manuel") + + def test_change_name_with_set_last_first(self): + self.env["ir.config_parameter"].sudo().set_param( + "employee_names_order", "last_first" + ) + self.employee1_id.write({"name": "Martinez Torres Pedro"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.firstname, "Pedro") + self.assertEqual(self.employee1_id.lastname, "Martinez") + self.assertEqual(self.employee1_id.lastname2, "Torres") + + self.employee1_id.write({"name": ""}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.firstname, "Pedro") + self.assertEqual(self.employee1_id.lastname, "Martinez") + self.assertEqual(self.employee1_id.lastname2, "Torres") + + def test_change_lastname_with_set_last_first_comma(self): + self.env["ir.config_parameter"].sudo().set_param( + "employee_names_order", "last_first_comma" + ) + self.employee1_id.write({"lastname": "Lopez"}) + self.employee1_id.invalidate_recordset() + + self.assertEqual(self.employee1_id.name, "Lopez Gonzalez, Manuel") diff --git a/hr_employee_second_lastname/views/hr_views.xml b/hr_employee_second_lastname/views/hr_views.xml new file mode 100644 index 00000000000..aaf04db184b --- /dev/null +++ b/hr_employee_second_lastname/views/hr_views.xml @@ -0,0 +1,15 @@ + + + + hr.employee.form.firstname.inherit + hr.employee + + + + + + + + + + From 496774eaa9528c72cec7f883d67eafece7a00a52 Mon Sep 17 00:00:00 2001 From: Andrea Gidalti Date: Thu, 21 Dec 2023 17:36:11 +0000 Subject: [PATCH 2/8] [IMP] hr_employee_second_lastname: pre-commit stuff --- hr_employee_second_lastname/README.rst | 20 ++++++++++--------- hr_employee_second_lastname/pyproject.toml | 3 +++ .../readme/CONTRIBUTORS.md | 2 ++ .../readme/CONTRIBUTORS.rst | 2 -- .../readme/DESCRIPTION.md | 2 ++ .../readme/DESCRIPTION.rst | 2 -- hr_employee_second_lastname/readme/USAGE.md | 4 ++++ hr_employee_second_lastname/readme/USAGE.rst | 2 -- .../static/description/index.html | 8 +++++--- 9 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 hr_employee_second_lastname/pyproject.toml create mode 100644 hr_employee_second_lastname/readme/CONTRIBUTORS.md delete mode 100644 hr_employee_second_lastname/readme/CONTRIBUTORS.rst create mode 100644 hr_employee_second_lastname/readme/DESCRIPTION.md delete mode 100644 hr_employee_second_lastname/readme/DESCRIPTION.rst create mode 100644 hr_employee_second_lastname/readme/USAGE.md delete mode 100644 hr_employee_second_lastname/readme/USAGE.rst diff --git a/hr_employee_second_lastname/README.rst b/hr_employee_second_lastname/README.rst index a12564e5fbd..5fad1c50eb5 100644 --- a/hr_employee_second_lastname/README.rst +++ b/hr_employee_second_lastname/README.rst @@ -28,8 +28,8 @@ HR Employee First Name and Two Last Names |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 =========== @@ -56,18 +58,18 @@ Credits ======= Authors -~~~~~~~ +------- * Vauxoo Contributors -~~~~~~~~~~~~ +------------ -* Luis Escobar -* Hugo Adan +- Luis Escobar +- Hugo Adan Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. diff --git a/hr_employee_second_lastname/pyproject.toml b/hr_employee_second_lastname/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/hr_employee_second_lastname/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_employee_second_lastname/readme/CONTRIBUTORS.md b/hr_employee_second_lastname/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..021f9de3f90 --- /dev/null +++ b/hr_employee_second_lastname/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Luis Escobar \<\> +- Hugo Adan \<\> diff --git a/hr_employee_second_lastname/readme/CONTRIBUTORS.rst b/hr_employee_second_lastname/readme/CONTRIBUTORS.rst deleted file mode 100644 index 03ab0b41c7d..00000000000 --- a/hr_employee_second_lastname/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Luis Escobar -* Hugo Adan diff --git a/hr_employee_second_lastname/readme/DESCRIPTION.md b/hr_employee_second_lastname/readme/DESCRIPTION.md new file mode 100644 index 00000000000..f8b51331199 --- /dev/null +++ b/hr_employee_second_lastname/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_second_lastname/readme/DESCRIPTION.rst b/hr_employee_second_lastname/readme/DESCRIPTION.rst deleted file mode 100644 index ef50535cd9a..00000000000 --- a/hr_employee_second_lastname/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_second_lastname/readme/USAGE.md b/hr_employee_second_lastname/readme/USAGE.md new file mode 100644 index 00000000000..4f2fb890ecc --- /dev/null +++ b/hr_employee_second_lastname/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_second_lastname/readme/USAGE.rst b/hr_employee_second_lastname/readme/USAGE.rst deleted file mode 100644 index 1c82d5662e4..00000000000 --- a/hr_employee_second_lastname/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_second_lastname/static/description/index.html b/hr_employee_second_lastname/static/description/index.html index c06dae539d3..e0be80d2e33 100644 --- a/hr_employee_second_lastname/static/description/index.html +++ b/hr_employee_second_lastname/static/description/index.html @@ -369,8 +369,8 @@

HR Employee First Name and Two Last Names

!! source digest: sha256:e3ad9ca8445db84cea2f6b86336a239e2277e208c08820c7e4ea30ad9d259fe8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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.

+

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

    @@ -388,7 +388,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).
From c88452c03a1a0fdb3f00959d443bcdf84c541713 Mon Sep 17 00:00:00 2001 From: Andrea Gidalti Date: Thu, 21 Dec 2023 17:50:52 +0000 Subject: [PATCH 3/8] [MIG] hr_employee_second_lastname: Migration to 17.0 - Fix some new lints. - Update incoming parameters of post_init_hook method since `cr, registry` were replaced by `env` in [1]. - Deprecate the use of _onchange_spec method and use the method new method _get_fields_spec to return the fields specification from a view description since it was introduced in [2]. [1] https://github.com/odoo/odoo/commit/b4a7996 [2] https://github.com/odoo/odoo/commit/f5e6494 --- hr_employee_second_lastname/__manifest__.py | 2 +- hr_employee_second_lastname/hooks.py | 9 +--- hr_employee_second_lastname/i18n/ca.po | 32 ++++++------- hr_employee_second_lastname/i18n/es.po | 32 ++++++------- hr_employee_second_lastname/i18n/hr.po | 36 +++++++-------- .../i18n/hr_employee_second_lastname.pot | 45 +++++++++++++++++++ hr_employee_second_lastname/i18n/it.po | 32 ++++++------- hr_employee_second_lastname/i18n/pt_BR.po | 32 ++++++------- .../models/hr_employee.py | 6 +-- .../tests/test_hr_employee_second_lastname.py | 20 ++++++--- 10 files changed, 148 insertions(+), 98 deletions(-) create mode 100644 hr_employee_second_lastname/i18n/hr_employee_second_lastname.pot diff --git a/hr_employee_second_lastname/__manifest__.py b/hr_employee_second_lastname/__manifest__.py index b6216e521b9..083ad630a6a 100644 --- a/hr_employee_second_lastname/__manifest__.py +++ b/hr_employee_second_lastname/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "HR Employee First Name and Two Last Names", - "version": "16.0.1.0.2", + "version": "17.0.1.0.0", "author": "Vauxoo, Odoo Community Association (OCA)", "maintainers": ["luisg123v"], "website": "https://github.com/OCA/hr", diff --git a/hr_employee_second_lastname/hooks.py b/hr_employee_second_lastname/hooks.py index 7026e3e6aaa..4cc61bc6070 100644 --- a/hr_employee_second_lastname/hooks.py +++ b/hr_employee_second_lastname/hooks.py @@ -1,8 +1,4 @@ -from odoo import SUPERUSER_ID -from odoo.api import Environment - - -def post_init_hook(cr, _): +def post_init_hook(env): # This SQL statement is necessary to call _install_employee_lastnames() and # set name fields correctly. # @@ -23,7 +19,6 @@ def post_init_hook(cr, _): # firstname = 'John' # lastname = 'Peterson' # lastname2 = 'Clinton' - cr.execute("UPDATE hr_employee SET firstname = NULL, lastname = NULL") - env = Environment(cr, SUPERUSER_ID, {}) + env.cr.execute("UPDATE hr_employee SET firstname = NULL, lastname = NULL") env["hr.employee"]._install_employee_lastnames() env["ir.config_parameter"].sudo().set_param("employee_names_order", "first_last") diff --git a/hr_employee_second_lastname/i18n/ca.po b/hr_employee_second_lastname/i18n/ca.po index 87be4c737aa..88e6d41daeb 100644 --- a/hr_employee_second_lastname/i18n/ca.po +++ b/hr_employee_second_lastname/i18n/ca.po @@ -16,34 +16,34 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base msgid "Basic Employee" msgstr "" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee msgid "Employee" msgstr "Empleat" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname msgid "First name" msgstr "Nom" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname msgid "Last name" msgstr "Primer cognom" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 msgid "Second last name" msgstr "Segon cognom" diff --git a/hr_employee_second_lastname/i18n/es.po b/hr_employee_second_lastname/i18n/es.po index d6c2a012554..d54a19bd4b8 100644 --- a/hr_employee_second_lastname/i18n/es.po +++ b/hr_employee_second_lastname/i18n/es.po @@ -17,34 +17,34 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.17\n" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base msgid "Basic Employee" msgstr "Empleado Básico" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee msgid "Employee" msgstr "Empleado" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname msgid "First name" msgstr "Nombre Propio" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname msgid "Last name" msgstr "Primer Apellido" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 msgid "Second last name" msgstr "Segundo Apellido" diff --git a/hr_employee_second_lastname/i18n/hr.po b/hr_employee_second_lastname/i18n/hr.po index 75110d71462..f7a92434c68 100644 --- a/hr_employee_second_lastname/i18n/hr.po +++ b/hr_employee_second_lastname/i18n/hr.po @@ -12,36 +12,36 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base msgid "Basic Employee" msgstr "" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee msgid "Employee" msgstr "" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname msgid "First name" msgstr "" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname msgid "Last name" msgstr "" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 msgid "Second last name" msgstr "" diff --git a/hr_employee_second_lastname/i18n/hr_employee_second_lastname.pot b/hr_employee_second_lastname/i18n/hr_employee_second_lastname.pot new file mode 100644 index 00000000000..00442361de8 --- /dev/null +++ b/hr_employee_second_lastname/i18n/hr_employee_second_lastname.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_second_lastname +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base +msgid "Basic Employee" +msgstr "" + +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname +msgid "First name" +msgstr "" + +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname +msgid "Last name" +msgstr "" + +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 +msgid "Second last name" +msgstr "" diff --git a/hr_employee_second_lastname/i18n/it.po b/hr_employee_second_lastname/i18n/it.po index 159b730d204..ce13dcb1563 100644 --- a/hr_employee_second_lastname/i18n/it.po +++ b/hr_employee_second_lastname/i18n/it.po @@ -16,33 +16,33 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.14.1\n" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base msgid "Basic Employee" msgstr "Dipendente base" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee msgid "Employee" msgstr "Dipendente" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname msgid "First name" msgstr "Nome" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname msgid "Last name" msgstr "Cognome" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 msgid "Second last name" msgstr "Secondo cognome" diff --git a/hr_employee_second_lastname/i18n/pt_BR.po b/hr_employee_second_lastname/i18n/pt_BR.po index d28bef9e7dd..1e5d78c6041 100644 --- a/hr_employee_second_lastname/i18n/pt_BR.po +++ b/hr_employee_second_lastname/i18n/pt_BR.po @@ -16,34 +16,34 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee_base +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base msgid "Basic Employee" msgstr "Funcionário Basico" -#. module: hr_employee_lastnames -#: model:ir.model,name:hr_employee_lastnames.model_hr_employee +#. module: hr_employee_second_lastname +#: model:ir.model,name:hr_employee_second_lastname.model_hr_employee msgid "Employee" msgstr "Funcionário" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__firstname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__firstname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__firstname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__firstname msgid "First name" msgstr "Nome" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname msgid "Last name" msgstr "Sobrenome" -#. module: hr_employee_lastnames -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_base__lastname2 -#: model:ir.model.fields,field_description:hr_employee_lastnames.field_hr_employee_public__lastname2 +#. module: hr_employee_second_lastname +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_base__lastname2 +#: model:ir.model.fields,field_description:hr_employee_second_lastname.field_hr_employee_public__lastname2 msgid "Second last name" msgstr "Segundo sobrenome" diff --git a/hr_employee_second_lastname/models/hr_employee.py b/hr_employee_second_lastname/models/hr_employee.py index 7f999b08dae..edf085ccdda 100644 --- a/hr_employee_second_lastname/models/hr_employee.py +++ b/hr_employee_second_lastname/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_second_lastname/tests/test_hr_employee_second_lastname.py b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py index 4ab6f2ad5fe..7f5c5259716 100644 --- a/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py +++ b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py @@ -1,10 +1,11 @@ from odoo import exceptions from odoo.tests.common import TransactionCase +from odoo.tools import submap class TestEmployeeSecondLastname(TransactionCase): def setUp(self): - super(TestEmployeeSecondLastname, self).setUp() + super().setUp() self.env["ir.config_parameter"].sudo().set_param( "employee_names_order", "first_last" ) @@ -45,9 +46,18 @@ def test_get_name_lastnames(self): def test_onchange(self): """Validate the _get_name_lastnames method is not failing""" - field_onchange = self.employee_model.new({})._onchange_spec() - self.assertEqual(field_onchange.get("firstname"), "1") - self.assertEqual(field_onchange.get("lastname"), "1") + # Check that fields used to generate the name and also name field + # are empty before onchange + fields_spec = self.env["hr.employee"]._get_fields_spec() + self.assertEqual( + submap(fields_spec, ("firstname", "lastname", "lastname2", "name")), + { + "firstname": {}, + "lastname": {}, + "lastname2": {}, + "name": {}, + }, + ) values = { "firstname": "Pedro", "lastname": "Perez", @@ -61,7 +71,7 @@ def test_onchange(self): new_record = self.employee_model.new(values) updates = new_record.onchange( - values, ["firstname", "lastname", "lastname2"], field_onchange + values, ["firstname", "lastname", "lastname2"], fields_spec ) values.update(updates.get("value", {})) self.assertEqual(values["name"], "Pedro Perez Hernandez") From 8503086bf051c62397cf0fecba8d5e0faa993ab0 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 26 Dec 2023 16:56:10 +0000 Subject: [PATCH 4/8] [BOT] post-merge updates --- hr_employee_second_lastname/README.rst | 2 +- hr_employee_second_lastname/i18n/hr.po | 4 ++-- hr_employee_second_lastname/static/description/index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hr_employee_second_lastname/README.rst b/hr_employee_second_lastname/README.rst index 5fad1c50eb5..6656a0d8d18 100644 --- a/hr_employee_second_lastname/README.rst +++ b/hr_employee_second_lastname/README.rst @@ -7,7 +7,7 @@ HR Employee First Name and Two Last Names !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:e3ad9ca8445db84cea2f6b86336a239e2277e208c08820c7e4ea30ad9d259fe8 + !! source digest: sha256:ea2fc004a6c716919eb89cf8230a55478a36bb3923aec54c9a7460aebbe73a45 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/hr_employee_second_lastname/i18n/hr.po b/hr_employee_second_lastname/i18n/hr.po index f7a92434c68..bed658b62d1 100644 --- a/hr_employee_second_lastname/i18n/hr.po +++ b/hr_employee_second_lastname/i18n/hr.po @@ -12,8 +12,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: hr_employee_second_lastname #: model:ir.model,name:hr_employee_second_lastname.model_hr_employee_base diff --git a/hr_employee_second_lastname/static/description/index.html b/hr_employee_second_lastname/static/description/index.html index e0be80d2e33..42bbbf29f7e 100644 --- a/hr_employee_second_lastname/static/description/index.html +++ b/hr_employee_second_lastname/static/description/index.html @@ -366,7 +366,7 @@

HR Employee First Name and Two Last Names

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:e3ad9ca8445db84cea2f6b86336a239e2277e208c08820c7e4ea30ad9d259fe8 +!! source digest: sha256:ea2fc004a6c716919eb89cf8230a55478a36bb3923aec54c9a7460aebbe73a45 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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 From 872f242f80ae6435b85b38c155e86cab1dca1e63 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 1 May 2024 20:21:52 +0200 Subject: [PATCH 5/8] [FIX] hr_employee_second_lastname: line too long --- hr_employee_second_lastname/hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hr_employee_second_lastname/hooks.py b/hr_employee_second_lastname/hooks.py index 4cc61bc6070..b50a5a72b79 100644 --- a/hr_employee_second_lastname/hooks.py +++ b/hr_employee_second_lastname/hooks.py @@ -9,7 +9,8 @@ def post_init_hook(env): # (firstname, lastname and lastname2). # # For example: - # After install hr_employee_fisrtname and before install hr_employee_second_lastname: + # After install hr_employee_fisrtname and before install + # hr_employee_second_lastname: # name = 'John Peterson Clinton' # firstname = 'John' # lastname = 'Peterson Clinton' From 1f3396ce2f8007dbc59a56d6483454e792206c36 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 1 May 2024 19:53:14 +0000 Subject: [PATCH 6/8] [BOT] post-merge updates --- hr_employee_second_lastname/README.rst | 2 +- hr_employee_second_lastname/__manifest__.py | 2 +- hr_employee_second_lastname/static/description/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hr_employee_second_lastname/README.rst b/hr_employee_second_lastname/README.rst index 6656a0d8d18..ab012492fbd 100644 --- a/hr_employee_second_lastname/README.rst +++ b/hr_employee_second_lastname/README.rst @@ -7,7 +7,7 @@ HR Employee First Name and Two Last Names !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ea2fc004a6c716919eb89cf8230a55478a36bb3923aec54c9a7460aebbe73a45 + !! source digest: sha256:92ab29e1e7ea1d47f493a5619cb6d50b6c2e6df9dfab19ba35547d491dcc7892 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/hr_employee_second_lastname/__manifest__.py b/hr_employee_second_lastname/__manifest__.py index 083ad630a6a..aed1a5c1dfb 100644 --- a/hr_employee_second_lastname/__manifest__.py +++ b/hr_employee_second_lastname/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "HR Employee First Name and Two Last Names", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "author": "Vauxoo, Odoo Community Association (OCA)", "maintainers": ["luisg123v"], "website": "https://github.com/OCA/hr", diff --git a/hr_employee_second_lastname/static/description/index.html b/hr_employee_second_lastname/static/description/index.html index 42bbbf29f7e..addf2ff8f49 100644 --- a/hr_employee_second_lastname/static/description/index.html +++ b/hr_employee_second_lastname/static/description/index.html @@ -366,7 +366,7 @@

HR Employee First Name and Two Last Names

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ea2fc004a6c716919eb89cf8230a55478a36bb3923aec54c9a7460aebbe73a45 +!! source digest: sha256:92ab29e1e7ea1d47f493a5619cb6d50b6c2e6df9dfab19ba35547d491dcc7892 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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 From 799ed15286205935c7a61ea099ab6a12104c0fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edilianny=20S=C3=A1nchez?= Date: Thu, 31 Oct 2024 23:16:19 +0000 Subject: [PATCH 7/8] [IMP] hr_employee_second_lastname: pre-commit auto fixes --- hr_employee_second_lastname/README.rst | 14 +++++++------- .../static/description/index.html | 17 ++++++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/hr_employee_second_lastname/README.rst b/hr_employee_second_lastname/README.rst index ab012492fbd..64f44c68000 100644 --- a/hr_employee_second_lastname/README.rst +++ b/hr_employee_second_lastname/README.rst @@ -17,13 +17,13 @@ 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/17.0/hr_employee_second_lastname + :target: https://github.com/OCA/hr/tree/18.0/hr_employee_second_lastname :alt: OCA/hr .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_second_lastname + :target: https://translation.odoo-community.org/projects/hr-18-0/hr-18-0-hr_employee_second_lastname :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=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -50,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. @@ -65,8 +65,8 @@ Authors Contributors ------------ -- Luis Escobar -- Hugo Adan +- Luis Escobar +- Hugo Adan Maintainers ----------- @@ -89,6 +89,6 @@ Current `maintainer `__: |maintainer-luisg123v| -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_second_lastname/static/description/index.html b/hr_employee_second_lastname/static/description/index.html index addf2ff8f49..ba7fbe517b5 100644 --- a/hr_employee_second_lastname/static/description/index.html +++ b/hr_employee_second_lastname/static/description/index.html @@ -8,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. @@ -274,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 } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@

HR Employee First Name and Two Last Names

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:92ab29e1e7ea1d47f493a5619cb6d50b6c2e6df9dfab19ba35547d491dcc7892 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

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

@@ -398,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.

@@ -419,13 +420,15 @@

Contributors

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.

Current maintainer:

luisg123v

-

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.

From 833abf061fb3c465a951bac9d75d79a3062c0125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edilianny=20S=C3=A1nchez?= Date: Thu, 31 Oct 2024 18:33:34 +0000 Subject: [PATCH 8/8] [MIG] hr_employee_second_lastname: Migration to 18.0 --- hr_employee_second_lastname/__manifest__.py | 2 +- .../tests/test_hr_employee_second_lastname.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hr_employee_second_lastname/__manifest__.py b/hr_employee_second_lastname/__manifest__.py index aed1a5c1dfb..5c7f115bb46 100644 --- a/hr_employee_second_lastname/__manifest__.py +++ b/hr_employee_second_lastname/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "HR Employee First Name and Two Last Names", - "version": "17.0.1.0.1", + "version": "18.0.1.0.0", "author": "Vauxoo, Odoo Community Association (OCA)", "maintainers": ["luisg123v"], "website": "https://github.com/OCA/hr", diff --git a/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py index 7f5c5259716..8f1ff1eb329 100644 --- a/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py +++ b/hr_employee_second_lastname/tests/test_hr_employee_second_lastname.py @@ -1,6 +1,6 @@ from odoo import exceptions from odoo.tests.common import TransactionCase -from odoo.tools import submap +from odoo.tools.misc import submap class TestEmployeeSecondLastname(TransactionCase):