From 2713c3d104f4a0f8fba847f99a320968c80c0df1 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Wed, 9 Mar 2022 17:49:24 +0000 Subject: [PATCH] [FIX] payment: hide acquirers not allowing tokenization when required Before this commit, the /payment/pay page would not filter out acquirers configured to allow tokenization when it was although required for the payment. For example, for sales order with a subscription product (which requires tokenization), acquirers that don't allow tokenization would be shown to the customer if they pay from the /payment/pay page, but not if they pay from the portal view of the SO. This commit makes sure the sales order id is correctly propagated to the Subscription app which then flags the payment as requiring tokenization. closes odoo/odoo#86202 X-original-commit: 9ab7b2447f2ece46f1a25335ab76f06323f03d22 Signed-off-by: Antoine Vandevenne (anv) --- addons/payment/controllers/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 80d5f6ac2e6..1fd4c8469aa 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -110,7 +110,7 @@ class PaymentPortal(portal.CustomerPortal): # Select all acquirers and tokens that match the constraints acquirers_sudo = request.env['payment.acquirer'].sudo()._get_compatible_acquirers( - company_id, partner_sudo.id, currency_id=currency.id + company_id, partner_sudo.id, currency_id=currency.id, **kwargs ) # In sudo mode to read the fields of acquirers and partner (if not logged in) if acquirer_id in acquirers_sudo.ids: # Only keep the desired acquirer if it's suitable acquirers_sudo = acquirers_sudo.browse(acquirer_id)