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:
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
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.
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.
On creating a new partner user needs to fill separate fields for last name and first name.
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.
Subsequent to the name recalculation, the order shall be modified in accordance with the selected option.