diff options
| author | tbe-odoo <tbe@odoo.com> | 2017-08-29 13:50:14 +0200 |
|---|---|---|
| committer | tbe-odoo <tbe@odoo.com> | 2017-08-29 17:16:42 +0200 |
| commit | 2a2a1c7b2843fc6fe0c82583120ce100fa4068fa (patch) | |
| tree | 1942c4e90d560121ffb1849af74d3b12d8833202 /addons | |
| parent | ad095e492f838f758614fd0bb6c1762fcee01441 (diff) | |
[IMP] payment,website_sale/quote: Renaming a field and labels
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/payment/controllers/portal.py | 2 | ||||
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 17 | ||||
| -rw-r--r-- | addons/payment/views/payment_templates.xml | 3 | ||||
| -rw-r--r-- | addons/payment/views/payment_views.xml | 2 | ||||
| -rw-r--r-- | addons/website_quote/controllers/main.py | 4 | ||||
| -rw-r--r-- | addons/website_sale/controllers/main.py | 4 |
6 files changed, 13 insertions, 19 deletions
diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 0ce8471e808..c7fb34607ed 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -8,7 +8,7 @@ from odoo.http import request class WebsitePayment(http.Controller): @http.route(['/my/payment_method'], type='http', auth="user", website=True) def payment_method(self, **kwargs): - acquirers = list(request.env['payment.acquirer'].search([('website_published', '=', True), ('registration_view_template_id', '!=', False), ('prefered_payment_type', 'in', ['s2s', 'both'])])) + acquirers = list(request.env['payment.acquirer'].search([('website_published', '=', True), ('registration_view_template_id', '!=', False), ('payment_flow', '=', 's2s')])) partner = request.env.user.partner_id payment_tokens = partner.payment_token_ids payment_tokens |= partner.commercial_partner_id.sudo().payment_token_ids diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 28c13ce458e..e9c8c86c85b 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -117,8 +117,8 @@ class PaymentAcquirer(models.Model): help='Message displayed, if error is occur during the payment process.') save_token = fields.Selection([ ('none', 'Never'), - ('ask', 'Let the customer decide (recommended for eCommerce)'), - ('always', 'Always (recommended for Subscriptions)')], + ('ask', 'Let the customer decide'), + ('always', 'Always')], string='Save Cards', default='none', help="This option allows customers to save their credit card as a payment token and to reuse it for a later purchase." "If you manage subscriptions (recurring invoicing), you need it to automatically charge the customer when you " @@ -151,15 +151,10 @@ class PaymentAcquirer(models.Model): "Use this field anywhere a small image is required.") payment_icon_ids = fields.Many2many('payment.icon', string='Supported Payment Icons') - prefered_payment_type = fields.Selection(selection=[('s2s','Server to server'), - ('form', 'Form'), - ('both', 'Both') - ], default='form', required=True, string='Prefered payment type', help="""Which payment type you wish to use. - - Form: Redirect the user to the payment acquirer website to pay. - - Server to server: The user enter his credit card information on your website and is processed by Odoo. - - Both: Both are displayed to the user. - - Note: Subscriptions does not take this field in account, it uses server to server by default.""") + payment_flow = fields.Selection(selection=[('s2s','The customer encode his payment details on the website.'), + ('form', 'The customer is redirected to the website of the acquirer.')], + default='form', required=True, string='Payment flow', + help="""Note: Subscriptions does not take this field in account, it uses server to server by default.""") def _search_is_tokenized(self, operator, value): tokenized = self._get_feature_support()['tokenize'] diff --git a/addons/payment/views/payment_templates.xml b/addons/payment/views/payment_templates.xml index 4327939a7e3..182a80bf8d7 100644 --- a/addons/payment/views/payment_templates.xml +++ b/addons/payment/views/payment_templates.xml @@ -101,8 +101,7 @@ </t> </ul> </div> - <div t-attf-id="o_payment_form_acq_{{acq.id}}" class="panel-footer hidden"> - <p>You'll be redirected to the <t t-esc="acq.provider"/> website after clicking on the payment button.</p> + <div t-attf-id="o_payment_form_acq_{{acq.id}}" t-attf-class="hidden {{'panel-footer' if acq.save_token == 'ask' else ''}}"> <label t-if="acq.save_token == 'ask'"><input type="checkbox" name="o_payment_form_save_token"/> Save my payment data</label> <t t-raw="acq.form"/> </div> diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml index abd9da665cf..365a57a7a01 100644 --- a/addons/payment/views/payment_views.xml +++ b/addons/payment/views/payment_views.xml @@ -113,7 +113,7 @@ </div> <field name="registration_view_template_id" groups="base.group_no_one"/> <field name="payment_icon_ids" widget="many2many_tags"/> - <field name="prefered_payment_type"/> + <field name="payment_flow" widget="radio"/> </group> </page> </notebook> diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index e30800169d7..859eb5f715c 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -69,8 +69,8 @@ class sale_quote(http.Controller): if order_sudo.require_payment or values['need_payment']: acquirers = request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id)]) - values['form_acquirers'] = [acq for acq in acquirers if acq.prefered_payment_type in ['form', 'both'] and acq.view_template_id] - values['s2s_acquirers'] = [acq for acq in acquirers if acq.prefered_payment_type in ['s2s', 'both'] and acq.registration_view_template_id] + values['form_acquirers'] = [acq for acq in acquirers if acq.payment_flow == 'form' and acq.view_template_id] + values['s2s_acquirers'] = [acq for acq in acquirers if acq.payment_flow == 's2s' and acq.registration_view_template_id] values['pms'] = request.env['payment.token'].search( [('partner_id', '=', order_sudo.partner_id.id), ('acquirer_id', 'in', [acq.id for acq in values['s2s_acquirers']])]) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 78c48c8b6e8..15ebd112268 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -716,8 +716,8 @@ class WebsiteSale(http.Controller): [('website_published', '=', True), ('company_id', '=', order.company_id.id)] ) - values['form_acquirers'] = [acq for acq in acquirers if acq.prefered_payment_type in ['form', 'both'] and acq.view_template_id] - values['s2s_acquirers'] = [acq for acq in acquirers if acq.prefered_payment_type in ['s2s', 'both'] and acq.registration_view_template_id] + values['form_acquirers'] = [acq for acq in acquirers if acq.payment_flow == 'form' and acq.view_template_id] + values['s2s_acquirers'] = [acq for acq in acquirers if acq.payment_flow == 's2s' and acq.registration_view_template_id] values['tokens'] = request.env['payment.token'].search( [('partner_id', '=', order.partner_id.id), ('acquirer_id', 'in', [acq.id for acq in values['s2s_acquirers']])]) |
