Files
odoo_source/addons/website_payment/models/website.py
T
tbe-odoo 378f4cdfec [IMP] payment: Supported payment options
- Added the ability to specify which payment option each payment acquirer supports and,
    displays those payment option on e-commerce footer.
2017-08-24 11:20:14 +02:00

16 lines
556 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class Website(models.Model):
_inherit = "website"
@api.model
def payment_options(self):
""" This function returns the list of payment options which are supported by payment acquirers that are published
"""
options = self.env['payment.option'].sudo().search([('acquirer_ids', '!=', False)])
return [opt for opt in options if any(acq.website_published for acq in opt.acquirer_ids)]