From b0cd9c13a0456e22c8dcd3e8f314fa23bf835f81 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Mon, 16 Mar 2020 08:59:48 +0000 Subject: [PATCH] [FIX] payment: use order company on payment page - The payment link generated by using the wizard `payment.link.wizard` are overriden to generate URL linked to sale orders. If so, we want the payment acquirer displayed to be in the same company as the sale order. closes odoo/odoo#49018 X-original-commit: 8c299efb6cb4355cec39cdedd8d7c3134f53d199 Signed-off-by: Toufik Benjaa (tbe) --- addons/payment/controllers/portal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 2fc980147f1..cefc8ad6d5e 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -199,6 +199,8 @@ class WebsitePayment(http.Controller): acquirers = None if acquirer_id: acquirers = env['payment.acquirer'].browse(int(acquirer_id)) + if order_id: + acquirers = env['payment.acquirer'].search([('state', 'in', ['enabled', 'test']), ('company_id', '=', order.company_id.id)]) if not acquirers: acquirers = env['payment.acquirer'].search([('state', 'in', ['enabled', 'test']), ('company_id', '=', user.company_id.id)])