[FIX] payment: avoid orphan tokens

Don't use token without the partner_id set
This commit is contained in:
Antoine Vandevenne
2021-09-21 09:47:51 +02:00
parent 34956c2b7c
commit 5146a07ef9
+2 -2
View File
@@ -258,8 +258,8 @@ class PaymentPortal(portal.CustomerPortal):
and tokenization_required_or_requested
)
elif flow == 'token': # Payment by token
token_sudo = request.env['payment.token'].sudo().browse(payment_option_id)
acquirer_sudo = token_sudo.acquirer_id
token = request.env['payment.token'].browse(payment_option_id)
acquirer_sudo = token.acquirer_id.sudo()
token_id = payment_option_id
tokenize = False
else: