Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Philippines - Accounting

Entity: res.partner

Compute Method: _l10n_ph_compute_split_name

Inputs Method Outputs
for partner in self:
            if 'PH' not in partner.fiscal_country_codes or partner.l10n_ph_entity_type == 'corporation' or not partner.name:
                partner.l10n_ph_first_name = False
                partner.l10n_ph_middle_name = False
                partner.l10n_ph_last_name = False
                continue

            first_name, middle_name, last_name, suffix = split_name(partner.name)
            if suffix:  # For names with a suffix, we append it to the first name excluding the dot.
                first_name += f" {suffix.replace('.', '')}"
            partner.l10n_ph_first_name = first_name
            partner.l10n_ph_middle_name = middle_name
            partner.l10n_ph_last_name = last_name

Back to entity