Skip to content
Snippets Groups Projects
Commit a6e8e0f6 authored by Thomas Lefebvre (thle)'s avatar Thomas Lefebvre (thle)
Browse files

[FIX] base_address_extended: auto complete issues


Steps to reproduce:
- install the "Extended Adresses" module;
- in the configuration menu --> countries, edit the street format for Belgium to "  %(street_name)s" (with whitespaces)
- create a new contact;
- select a contact suggested by the auto complete feature (for example Odoo)

Issue:
    Some letters are removed if we add whitespaces in the street format (street_name field has the value "e du Laid Burniat 5" instead of "Rue du Laid Burniat 5").

Cause:
    The function which splits the raw address taking into account heading characters.
    Therefore the function truncates whatever is in front of the first field of the street format which is normally the image of the address (street_raw).

    Example 1: (correct use)
    street_raw = "header Rue du Laid Burniat 5"
    street_format = "header %(street_name)s"

    street_name = "Rue du Laid Burniat 5" --> OK (format address is properly configured to match with street_raw)

    Example 2: (incorrect use but desired behavior)
    street_raw = "Rue du Laid Burniat 5"
    street_format = "header %(street_name)s"

    street_name = "Laid Burniat 5" --> truncation is expected (7 leading characters are removed) (format address is not properly configured to match with street_raw)

    Example 3: (incorrect use and unwanted behavior)
    street_raw = "Rue du Laid Burniat 5"
    street_format = " %(street_name)s"

    street_name = "ue du Laid Burniat 5" --> truncation is not expected (1 leading character is removed) (format address is "properly" configured but with whitespace)

Solution:
    Remove whitespaces before street format when editing this field to prevent truncation of the field value.

opw-2964457

closes odoo/odoo#99224

Signed-off-by: default avatarQuentin De Paoli <qdp@odoo.com>
parent 2b0587fb
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment