diff options
Diffstat (limited to 'addons/website_payment')
| -rw-r--r-- | addons/website_payment/models/website.py | 7 | ||||
| -rw-r--r-- | addons/website_payment/views/website_payment_templates.xml | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/addons/website_payment/models/website.py b/addons/website_payment/models/website.py index 540277d79c2..0bb533cd1c9 100644 --- a/addons/website_payment/models/website.py +++ b/addons/website_payment/models/website.py @@ -8,5 +8,8 @@ class Website(models.Model): _inherit = "website" @api.model - def payment_acquirers(self): - return list(self.env['payment.acquirer'].sudo().search([('website_published', '=', True)])) + 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)] diff --git a/addons/website_payment/views/website_payment_templates.xml b/addons/website_payment/views/website_payment_templates.xml index c49937bb83f..95d5d44cbf2 100644 --- a/addons/website_payment/views/website_payment_templates.xml +++ b/addons/website_payment/views/website_payment_templates.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> - <template id="header_footer_custom_payment" inherit_id="website.footer_default" customize_show="True" active="False" name="Payment Methods"> + <template id="header_footer_custom_payment" inherit_id="website.footer_default" customize_show="True" active="False" name="Payment Options"> <xpath expr="//div[@id='info']" position="inside"> - <h4 class="payment_method_title">Payment Methods</h4> + <h4 class="payment_method_title">Payment Options</h4> <ul class="payment_method_list list-inline"> - <t t-foreach="request.website.payment_acquirers()" t-as="acquirer"> + <t t-foreach="request.website.payment_options()" t-as="option"> <li> - <span t-field="acquirer.image_small" t-options='{"widget": "image", "alt-field": "name"}' /> + <span t-field="option.image_small" t-options='{"widget": "image", "alt-field": "name"}' /> </li> </t> </ul> |
