[FIX] payment_adyen: incorrect parsing of partner's address

When passing the customer data to adyen to execute a payment an error occurred if the address did not follow a pattern that might be
unkown to the customer.
This fix allows for the user to be aware of what the issue is through
the logs and inform the customer if necessary.

opw - 3171407

closes odoo/odoo#116936

X-original-commit: 66716551f1f75d228876b49cda9fd92732756afc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
This commit is contained in:
Horacio Tellez
2023-03-29 08:28:52 +02:00
parent 1edaf4fce9
commit 6769a42e92
+3 -2
View File
@@ -52,6 +52,7 @@ def format_partner_address(partner):
'country': partner.country_id.code or 'ZZ', # 'ZZ' if the country is not known.
'stateOrProvince': partner.state_id.code,
'postalCode': partner.zip,
'street': street_data['street_name'],
'houseNumberOrName': street_data['street_number'],
# Fill in the address fields if the format is supported, or fallback to the raw address.
'street': street_data.get('street_name', partner.street),
'houseNumberOrName': street_data.get('street_number'),
}