From cc793480fcabc5036461e125452ae2905080def0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 24 Jan 2014 14:46:52 +0100 Subject: [PATCH] [IMP] payment: renamed message in pre_msg, msg displayed before payment. Added post_msg, message displayed after payment. [IMP] payment_transfer: added a default value (generated at create) for post_msg, that contains bank accounts details. bank accounts linked to the current company and used in report footer are shown. [FIX] payment_*: make the buttons noupdate. [IMP] payment: portal_published -> website_published + propagation [IMP] payment: added process selection field that will be used for some control in the website, telling w hether we want to refresh a payment validation page or not. bzr revid: tde@openerp.com-20140124134652-cc0nz08znnlmftw4 --- addons/payment/models/payment_acquirer.py | 16 +++++++---- addons/payment/views/payment_acquirer.xml | 7 +++-- addons/payment_adyen/views/adyen.xml | 2 +- addons/payment_ogone/views/ogone.xml | 2 +- addons/payment_paypal/data/paypal.xml | 2 +- addons/payment_paypal/models/res_company.py | 4 +-- addons/payment_paypal/views/paypal.xml | 2 +- addons/payment_transfer/data/transfer.xml | 6 ++-- .../models/payment_acquirer.py | 28 +++++++++++++++++++ addons/payment_transfer/views/transfer.xml | 2 +- addons/website_sale/controllers/main.py | 2 +- 11 files changed, 54 insertions(+), 19 deletions(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 39e8624b359..1ddca499af7 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -55,13 +55,18 @@ class PaymentAcquirer(osv.Model): _columns = { 'name': fields.char('Name', required=True), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'message': fields.html('Message', help='Message displayed to help payment and validation'), + 'pre_msg': fields.html('Message', help='Message displayed to explain and help the payment process.'), + 'post_msg': fields.html('Thanks Message', help='Message displayed after having done the payment process.'), + 'process': fields.selection( + [('static', 'Static'), ('dynamic', 'Dynamic')], + string='Process Method', + help='Static payments are payments like transfer, that require manual steps.'), 'view_template_id': fields.many2one('ir.ui.view', 'Form Button Template', required=True), 'env': fields.selection( [('test', 'Test'), ('prod', 'Production')], string='Environment'), - 'portal_published': fields.boolean( - 'Visible in Portal', + 'website_published': fields.boolean( + 'Visible in Portal / Website', help="Make this payment acquirer available (Customer invoices, etc.)"), # Fees 'fees_active': fields.boolean('Compute fees'), @@ -74,7 +79,8 @@ class PaymentAcquirer(osv.Model): _defaults = { 'company_id': lambda self, cr, uid, obj, ctx=None: self.pool['res.users'].browse(cr, uid, uid).company_id.id, 'env': 'test', - 'portal_published': True, + 'process': 'dynamic', + 'website_published': True, } def _check_required_if_provider(self, cr, uid, ids, context=None): @@ -272,7 +278,7 @@ class PaymentAcquirer(osv.Model): def render_payment_block(self, cr, uid, reference, amount, currency_id, tx_id=None, partner_id=False, partner_values=None, tx_values=None, context=None): html_forms = [] # TDE FIXME: change this domain, see with CHM about 'dynamic/static' acquirer - acquirer_ids = self.search(cr, uid, [('portal_published', '=', True), ('name', '!=', 'transfer')], context=context) + acquirer_ids = self.search(cr, uid, [('website_published', '=', True), ('name', '!=', 'transfer')], context=context) for acquirer_id in acquirer_ids: button = self.render( cr, uid, acquirer_id, diff --git a/addons/payment/views/payment_acquirer.xml b/addons/payment/views/payment_acquirer.xml index 9f7429d3f22..5dbd748bda7 100644 --- a/addons/payment/views/payment_acquirer.xml +++ b/addons/payment/views/payment_acquirer.xml @@ -17,7 +17,7 @@ - + @@ -33,7 +33,8 @@ - + +