From d6a30df5cc8816c24191c4e852f3fca619c9d83f Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 12 May 2015 18:07:22 +0200 Subject: [PATCH] [IMP] website_payment: add payment method in footer (optionnal and desactivate by defaut) Add all acquirers published in the automatic footer --- addons/website_payment/__init__.py | 2 + addons/website_payment/models/__init__.py | 1 + addons/website_payment/models/website.py | 9 ++++ .../static/src/css/website_payment.css | 5 ++ .../views/website_payment_templates.xml | 47 ++++++++----------- 5 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 addons/website_payment/models/__init__.py create mode 100644 addons/website_payment/models/website.py diff --git a/addons/website_payment/__init__.py b/addons/website_payment/__init__.py index 67dee8c60db..81fc81d29c9 100644 --- a/addons/website_payment/__init__.py +++ b/addons/website_payment/__init__.py @@ -1,2 +1,4 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. + +import models diff --git a/addons/website_payment/models/__init__.py b/addons/website_payment/models/__init__.py new file mode 100644 index 00000000000..b8b239729b6 --- /dev/null +++ b/addons/website_payment/models/__init__.py @@ -0,0 +1 @@ +import website \ No newline at end of file diff --git a/addons/website_payment/models/website.py b/addons/website_payment/models/website.py new file mode 100644 index 00000000000..9d3be858011 --- /dev/null +++ b/addons/website_payment/models/website.py @@ -0,0 +1,9 @@ +from openerp import api, models + + +class Website(models.Model): + _inherit = "website" + + @api.model + def payment_acquirers(self): + return list(self.env['payment.acquirer'].sudo().search([('website_published', '=', True)])) diff --git a/addons/website_payment/static/src/css/website_payment.css b/addons/website_payment/static/src/css/website_payment.css index 196d6cf8956..e8b350e6d18 100644 --- a/addons/website_payment/static/src/css/website_payment.css +++ b/addons/website_payment/static/src/css/website_payment.css @@ -51,3 +51,8 @@ div.visa { input#cc_number:active, input#cc_number:focus { background-image: none; } + +ul.payment_method_list img.img-rounded { + max-width: 100px; + max-height: 40px; +} diff --git a/addons/website_payment/views/website_payment_templates.xml b/addons/website_payment/views/website_payment_templates.xml index 2c7c08748b7..3a1bee86875 100644 --- a/addons/website_payment/views/website_payment_templates.xml +++ b/addons/website_payment/views/website_payment_templates.xml @@ -1,31 +1,22 @@ - - - - + + + + + +