OdooWiki OCA HUB

Partner first name and last name

partner_firstname folder_open OCA/partner-contact open_in_new
Extra Tools License: AGPL-3

This module was written to extend the functionality of contacts to support having separate last name and first name.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Splits a contact's full name into separate First name and Last name fields, and rebuilds the displayed name from them in the order you choose. You can also decide whether first name, last name or both are mandatory.

This module changes how individual contacts (people, not companies) are named in Odoo. Instead of one free-text name, each person gets a First name and a Last name field, and the usual displayed name is rebuilt automatically from those two parts.

Where it appears: - On the contact form and the simplified contact form, the single name field is replaced by First name and Last name fields for individuals; companies keep a single name. - The same split fields appear in the inline form used to add child contacts. - On the user form, First name and Last name fields are added after the email field, and the plain name becomes read-only. - In Settings, a new "Partner Names" block lets you choose the display order (Lastname Firstname, Lastname, Firstname, or Firstname Lastname) and which fields are required (both, first name only, last name only, or nothing).

Automatic behaviour: - When you type a full name, it is split into first and last name using the chosen order; extra spaces are cleaned up. - When you change first or last name, the displayed name is recalculated. - A validation error is raised if a required name part is missing for an individual contact, or if a company has no name. - When a contact is duplicated, the "(copy)" suffix is added to the first or last name according to the order setting. - A "Recalculate names" button appears in Settings once you change the order, to rebuild names for existing individual contacts that have both parts filled in. - When the module is installed, existing contact names are parsed and split into first and last names.

Depends on

base_setup
Models and fields (4)
  • res.users · new model
  • res.partner · new modelname, lastname (Last name), firstname (First name)
  • firstname.mixin · new modellastname_required, firstname_required, form_has_lastname_first
  • res.config.settings · extends an existing modelpartner_names_order, partner_names_order_changed, partner_names_required_fields

Text generated by AI (DeepSeek) from reading the Odoo 19.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: 8 confirmed, 1 with no information of 9 versions.

Sources · Odoo 19.0

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

terminal Installation and usage

OCA documentation · Odoo 19.0

Fields Order

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

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

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 lastname and firstname from a simple string and also _get_computed_name to get a name form the lastname and firstname. These methods can be overridden to change the format specified above.

Required Fields

you can configure if firstname and / or lastname are required, in "Settings \> General Settings":

The field name becomes a stored function field concatenating the last name and the first name. This avoids breaking compatibility with other modules.

Users should fulfill manually the separate fields for last name and first name, but in case you edit just the name field in some unexpected module, there is an inverse function that tries to split that automatically. It assumes that you write the name in format configured ("Lastname Firstname", by default), but it could lead to wrong splitting (because it's just blindly trying to guess what you meant), so you better specify it manually.

For the same reason, after installing, previous names for contacts will stay in the name field, and the first time you edit any of them you will be asked to supply the last name and first name (just once per contact).

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.