Skip to content
Snippets Groups Projects
Commit e3143f14 authored by Valentin Vallaeys (vava)'s avatar Valentin Vallaeys (vava)
Browse files

[FIX] payment: fallback on transaction partner parent name


In a Sale Order, it is possible to select an invoice address without a
name. The partner of the transaction does not have a name, which leads
to a traceback when trying to split the name.

The idea is to force the name to be filled, with a fallback on the
partner' parent name.

OPW-3338406

closes odoo/odoo#125236

X-original-commit: 505109d4
Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: default avatarVallaeys Valentin (vava) <vava@odoo.com>
parent d65f5448
No related branches found
No related tags found
No related merge requests found
......@@ -172,7 +172,8 @@ class PaymentTransaction(models.Model):
# Duplicate partner values.
partner = self.env['res.partner'].browse(values['partner_id'])
values.update({
'partner_name': partner.name,
# Use the parent partner as fallback if the invoicing address has no name.
'partner_name': partner.name or partner.parent_id.name,
'partner_lang': partner.lang,
'partner_email': partner.email,
'partner_address': payment_utils.format_partner_address(
......
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