Skip to content

[18.0][IMP] hr_employee_second_lastname: Add new name order format "Lastname, Firstname SecondLastname"#1554

Open
BhaveshHeliconia wants to merge 1 commit intoOCA:18.0from
HeliconiaIO:18.0-imp-hr_employee_second_lastname
Open

[18.0][IMP] hr_employee_second_lastname: Add new name order format "Lastname, Firstname SecondLastname"#1554
BhaveshHeliconia wants to merge 1 commit intoOCA:18.0from
HeliconiaIO:18.0-imp-hr_employee_second_lastname

Conversation

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor

This PR introduces a new name order format for employees: Lastname, Firstname SecondLastname (e.g., Fernandez, Manuel Gonzalez).

Changes:

  • Added the last_first_comma2 option in Settings → General Settings → Employee Names Order.
  • Updated _get_name_lastnames and _get_inverse_name in hr.employee to handle concatenation and splitting for the new format.
  • Added comprehensive test cases in test_hr_employee_second_lastname.py to cover:
    • Standard format: "Martinez, Pedro Torres"
    • Missing second lastname: "Martinez, Pedro"
    • Only lastname: "Martinez"
    • Extra whitespaces: " Martinez , Pedro Torres "
  • Updated readme/DESCRIPTION.md and readme/USAGE.md to reflect the new functionality and usage instructions.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @luisg123v,
some modules you are maintaining are being modified, check this out!


order = self._get_names_order()

if order == "last_first_comma2":
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not put this algorithm in _get_inverse_name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please elaborate on what you meant? I think I've already placed this logic inside _get_inverse_name. Maybe I'm missing something or misunderstanding your point.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, in the "original function", not the overloaded one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't because 'lastname2' field is introduced in 'hr_employee_second_lastname' module and we've used this field in this new name format

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming 🙂

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-imp-hr_employee_second_lastname branch from 3cd6c9c to 007dec8 Compare March 30, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants