OdooWiki OCA HUB

Partner second last name

partner_second_lastname folder_open OCA/partner-contact open_in_new
Partner Management License: AGPL-3

This module was written to extend the functionality of partner_firstname to support having a second lastname for contact partners.

In some countries, it's important to have a second last name for contacts.

Contact partners will need to fill at least one of the name fields (First name, First last name or Second last name).

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Adds a "Second last name" field to contacts and users, so full names can be split into first name, first last name and second last name. The displayed name is rebuilt automatically from these parts.

This module extends the contact name splitting feature with an extra field called "Second last name" (lastname2). It appears on contact forms, on the simplified contact form and on the user form, next to the first name and first last name fields.

  • At least one of the three parts (first name, first last name, second last name) must be filled in for a contact; the other fields become required only when the second last name is empty.
  • The full name shown for a contact is computed automatically from the three parts, following the name order configured in Odoo settings (for example "Lastname SecondLastname Firstname" or "Firstname Lastname SecondLastname").
  • When a contact is duplicated, the "(copy)" suffix is added to the second last name instead of the first last name in the "first name first" order.
  • The settings screen offers updated labels for the name order options that now mention the second last name, and the recalculation of names also considers contacts that only have a second last name.

It touches the res.partner and res.users models and the configuration settings screen. No new menus or reports are added.

Models and fields (1)
  • res.partner · extends an existing modellastname2 (Second last name)

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 7 confirmed, 2 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/partner-contact.

terminal Installation and usage

OCA documentation · Odoo 18.0

You can configure some common name patterns for the inverse function in Settings \> Configuration \> General settings:

  • Lastname SecondLastname Firstname: For example 'Anderson Lavarge Robert'
  • Lastname SecondLastname, Firstname: For example 'Anderson Lavarge, Robert'
  • Firstname Lastname SecondLastname: For example 'Robert Anderson Lavarge'

After applying the changes, you can recalculate all partners name clicking "Recalculate names" button. Note: This process could take so much time depending how many partners there are in database.

You can use _get_inverse_name method to get firstname, lastname and second lastname from a simple string and also _get_computed_name to get a name form the firstname, lastname and second lastname. These methods can be overridden to change the format specified above.

To use this module, you need to:

  • Edit any partner's form.
  • Make sure the partner is not a company.
  • Enter firstname, lastnames, secondlast name.

If you directly enter the full name instead of entering the other fields separately (maybe from other form), this module will try to guess the best match for your input and split it between firstname, lastname and second lastname using an inverse function.

If you can, always enter it manually please. Automatic guessing could fail for you easily in some corner cases.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.