Skip to content

[18.0][IMP] partner_second_lastname: add name order 'Lastname, Firstname SecondLastname' - #2309

Open
BhaveshHeliconia wants to merge 1 commit into
OCA:18.0from
HeliconiaIO:18.0-imp-partner_second_lastname
Open

[18.0][IMP] partner_second_lastname: add name order 'Lastname, Firstname SecondLastname'#2309
BhaveshHeliconia wants to merge 1 commit into
OCA:18.0from
HeliconiaIO:18.0-imp-partner_second_lastname

Conversation

@BhaveshHeliconia

Copy link
Copy Markdown
Contributor

This PR adds a new name formatting option: Lastname, Firstname SecondLastname (key: last_first_comma2).

Improvements:

  • Added last_first_comma2 to res.config.settings.
  • Implemented computed name logic and inverse name logic in res.partner for the new format.
  • Fixed a potential IndexError in _get_computed_name when lastname is missing.
  • Updated documentation in CONFIGURE.md.
  • Added comprehensive tests in test_config.py, test_multiple_names.py, and test_name.py.

return [(k, new_labels[k]) if k in new_labels else (k, v) for k, v in options]
result = [(k, new_labels[k]) if k in new_labels else (k, v) for k, v in options]
# Separate format where only the first lastname is followed by a comma
result.append(("last_first_comma2", "Lastname, Firstname SecondLastname"))

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 didn't you add it directly to the new_labels dict?

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.

@luisDIXMIT Here, if we add it to 'new_labels' dict, then it won't get added in 'result' as we're looping on 'options' and 'options' don't have 'last_first_comma2', so we've added it separately afterwards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Oh, thanks for explaining me!

@luisDIXMIT luisDIXMIT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested on runboat and LGTM!

@legalsylvain legalsylvain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we add new key, we should propose changes in related OCA modules. don't you think ?
At least :
./hr/hr_employee_firstname
./hr/hr_employee_second_lastname/
./partner-contact/partner_second_lastname/

Thanks !

@BhaveshHeliconia

Copy link
Copy Markdown
Contributor Author

If we add new key, we should propose changes in related OCA modules. don't you think ? At least : ./hr/hr_employee_firstname ./hr/hr_employee_second_lastname/ ./partner-contact/partner_second_lastname/

Thanks !

Yes, you're right. This should also be handled in the hr_employee_second_lastname module. I'll take a look and propose the necessary changes there as well.

@BhaveshHeliconia

Copy link
Copy Markdown
Contributor Author

@legalsylvain here is the PR for hr_employee_second_lastname: OCA/hr#1554

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 26, 2026
@BhaveshHeliconia
BhaveshHeliconia force-pushed the 18.0-imp-partner_second_lastname branch from f3e30c1 to 0d3217d Compare July 27, 2026 05:03
@OCA-git-bot OCA-git-bot added series:18.0 mod:partner_second_lastname Module partner_second_lastname labels Jul 27, 2026
@BhaveshHeliconia
BhaveshHeliconia force-pushed the 18.0-imp-partner_second_lastname branch from 0d3217d to 9b8b38f Compare July 27, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:partner_second_lastname Module partner_second_lastname series:18.0 stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants