Repository
OCA/partner-contact · module folder · Try on Runboat
Module version
1.0.1
Category
Extra Tools
Folder size
0.39 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/partner-contact
Last tracking update
2026-08-07 09:06:26
Authors
Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA), GRAP, Tecnativa, LasLabs, Grupo ESOC Ingeniería de Servicios, DynApps NV
Maintainers
Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA), GRAP, Tecnativa, LasLabs, Grupo ESOC Ingeniería de Servicios, DynApps NV
Committers
Weblate, OCA-git-bot, oca-ci, Pierre Halleux, AEstLo
Odoo dependencies
odoo/odoo:
- web
Python dependencies
None
System dependencies
None
Required by
None
Description
This module was written to extend the functionality of contacts to
support having separate last name and first name.

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
res_config_settings_view_form Add partner_names_order config parameter res.config.settings form Inherits base_setup.res_config_settings_view_form
view_partner_form res.partner form Inherits base.view_partner_form
view_partner_simple_form res.partner form Inherits base.view_partner_simple_form
view_users_form Add firstname and surnames res.users form Inherits base.view_users_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (4)

New fields (3)
  • firstname_required Boolean
    compute='_compute_firstname_lastname_required'
  • form_has_lastname_first Boolean
    compute='_compute_form_has_lastname_first'
  • lastname_required Boolean
    compute='_compute_firstname_lastname_required'
Public methods (2)
  • default_get(self, fields_list)
    @api.model
    Invert name when getting default values.
  • name_fields_in_vals(self, vals)
    @api.model
    Method to check if any name fields are in `vals`.

New fields (3)
  • partner_names_order Selection
    config_parameter='partner_names_order' default=<expr> help='Order to compose partner fullname' inverse='_inverse_partner_names_order' required=True selection='_partner_names_order_selection'
  • partner_names_order_changed Boolean
    config_parameter='partner_names_order_changed'
  • partner_names_required_fields Selection
    config_parameter='partner_firstname.required_fields' help='Define which fields are required or not' required=True selection='_partner_names_required_fields_selection'
Public methods (1)
  • action_recalculate_partners_name(self)

New fields (3)
  • firstname Char
    index=True args: 'First name'
  • lastname Char
    index=True args: 'Last name'
  • name Char
    compute='_compute_name' inverse='_inverse_name_after_cleaning_whitespace' readonly=False required=False store=True
Public methods (3)
  • copy(self, default=None)
    Ensure partners are copied right. Odoo adds ``(copy)`` to the end of :attr:`~.name`, but that would get ignored in :meth:`~.create` because it also copies explicitly firstname and lastname fields.
  • create(self, vals_list)
    @api.model_create_multi
    Add inverted names at creation if unavailable. Also, remove the full name from `vals` and context if the partner is an individual and is being created with any name fields, as the name must be computed from the provided name parts; otherwise, the name fields will be computed from the `name` again, when calling its inverse method. Note that, to avoid deleting the 'default_name' context for all partners when it's not appropriate, we must call `create` for each partner individually with the correct context.
  • get_extra_default_copy_values(self)
    Method to add '(copy)' suffix to lastname or firstname, depending on name order configuration.

New fields (0)

No new fields.

Public methods (1)
  • copy(self, default=None)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…