Odoo
Cyllo

# Partner First name and Last name

This module, Partner First name and Last name extend the functionality of contacts to support having separate last name and first name.

You can Customize how partner names appear by choosing from three display formats from : "First Name Last Name," "Last Name First Name," or "Last Name, First Name."

This module split first name and last name for non company partners. 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 as follows to change the format specified above.

                             class ResPartner(models.Model):
                                _inherit = "res.partner"

                                def _get_inverse_name(self, name, is_company=False):
                                    base_inverse_name = super()._get_inverse_name(name, is_company)
                                    # Customize
                                    return base_inverse_name

#### Key Features

- Split first name and last name for non company partners
- Users can configure the name pattern
- Easy to configure

##### Compatibility-preserving Field Naming

This feature defines a naming convention where the field name becomes a stored function that concatenates the last and first name. This approach avoids breaking compatibility with existing modules that rely on the original field names.

##### Dynamic Field Construction

This feature utilizes stored functions to construct field names dynamically. The stored function combines the last and first name, providing flexibility and ensuring compatibility with existing systems that might expect specific field names.

##### Create New Partner

On creating a new partner user needs to fill separate fields for last name and first name.

##### Configure Name Pattern

To configure name patterns go to Settings > General settings > Partner Names Order & Choose the pattern. After applying the changes, you can recalculate all partners name clicking "Recalculate names" button.

##### Pattern Changed

Subsequent to the name recalculation, the order shall be modified in accordance with the selected option.

Disabled tab content