[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) <tbe@odoo.com>
This commit is contained in:
Toufik Ben Jaa
2020-04-06 09:24:28 +00:00
parent 473be98911
commit b0cd9c13a0
+2
View File
@@ -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)])