diff options
| author | Jeremy Kersten <jke@odoo.com> | 2015-05-12 18:07:22 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2015-06-10 21:50:50 +0200 |
| commit | d6a30df5cc8816c24191c4e852f3fca619c9d83f (patch) | |
| tree | b81ff14d8f5b368c1ce80f1a57ffa976ab9dd6ad /addons | |
| parent | c4a6e504e3b3dfa116d1b36d88cbd60ee6ebd8b0 (diff) | |
[IMP] website_payment: add payment method in footer
(optionnal and desactivate by defaut)
Add all acquirers published in the automatic footer
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_payment/__init__.py | 2 | ||||
| -rw-r--r-- | addons/website_payment/models/__init__.py | 1 | ||||
| -rw-r--r-- | addons/website_payment/models/website.py | 9 | ||||
| -rw-r--r-- | addons/website_payment/static/src/css/website_payment.css | 5 | ||||
| -rw-r--r-- | addons/website_payment/views/website_payment_templates.xml | 47 |
5 files changed, 36 insertions, 28 deletions
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 @@ <?xml version="1.0" encoding="utf-8"?> <openerp> -<!-- Page --> -<data> -<template id="cc_form" name="Paypal (Test)" page="True"> - <div class="row"> - <h3>Paypal payment: server 2 server</h3> - <form class="form-horizontal col-sm-4 oe_cc" role="form"> - <div class="form-group col-sm-8"> - <label class="control-label" for="cc_number">Card number</label> - <input type="tel" id="cc_number" class="form-control"/> - <div class="card_placeholder"></div> - <div class="visa"></div> - </div> - <div class="form-group col-sm-4"> - <label class="control-label" for="cc_cvc">Card code</label> - <input type="text" id="cc_cvc" class="form-control" maxlength="4" palceholder="CVC"/> - </div> - <div class="form-group col-sm-7"> - <label class="control-label" for="cc_holder_name">Holder Name</label> - <input type="text" id="cc_hoder_name" class="form-control"/> - </div> - <div class="form-group col-sm-5"> - <label class="control-label" for="cc_expires_mm">Expires</label> - <input type="text" id="cc_expiry" class="form-control" maxlength="7" placeholder="MM / YY"/> - </div> - </form> - </div> -</template> -</data> + <data> + <template id="header_footer_custom_payment" inherit_id="website.footer_default" customize_show="True" active="False" name="Payment Methods"> + <xpath expr="//div[@id='info']" position="inside"> + <h4 class="payment_method_title">Payment Method</h4> + <ul class="payment_method_list list-inline"> + <t t-foreach="request.website.payment_acquirers()" t-as="acquirer"> + <li><img class="img-rounded" t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.provider, acquirer.provider)"/></li> + </t> + </ul> + </xpath> + </template> + + <template id="assets_frontend" inherit_id="website.assets_frontend" name="Payment Frontend assets"> + <xpath expr="." position="inside"> + <link rel="stylesheet" href="/website_payment/static/src/css/website_payment.css"/> + </xpath> + </template> + + </data> </openerp> |
