diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 7af7c39b852..88511ff037c 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -116,6 +116,7 @@ class PaymentPortal(portal.CustomerPortal): providers_sudo.ids, partner_sudo.id, currency_id=currency.id, + **kwargs, ) # In sudo mode to read the fields of providers. tokens_sudo = request.env['payment.token'].sudo()._get_available_tokens( providers_sudo.ids, partner_sudo.id diff --git a/addons/payment/models/payment_method.py b/addons/payment/models/payment_method.py index c737531ebab..5af8dfea3a9 100644 --- a/addons/payment/models/payment_method.py +++ b/addons/payment/models/payment_method.py @@ -185,7 +185,7 @@ class PaymentMethod(models.Model): def _get_compatible_payment_methods( self, provider_ids, partner_id, currency_id=None, force_tokenization=False, - is_express_checkout=False + is_express_checkout=False, **kwargs ): """ Search and return the payment methods matching the compatibility criteria. @@ -201,6 +201,7 @@ class PaymentMethod(models.Model): :param bool force_tokenization: Whether only payment methods supporting tokenization can be matched. :param bool is_express_checkout: Whether the payment is made through express checkout. + :param dict kwargs: Optional data. This parameter is not used here. :return: The compatible payment methods. :rtype: payment.method """ diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py index c5e6043201f..52405db45da 100644 --- a/addons/sale/controllers/portal.py +++ b/addons/sale/controllers/portal.py @@ -219,6 +219,8 @@ class CustomerPortal(payment_portal.PaymentPortal): providers_sudo.ids, partner_sudo.id, currency_id=currency.id, + sale_order_id=order_sudo.id, + **kwargs, ) # In sudo mode to read the fields of providers. tokens_sudo = request.env['payment.token'].sudo()._get_available_tokens( providers_sudo.ids, partner_sudo.id, **kwargs