diff options
| author | Benoit Socias <bso@odoo.com> | 2020-11-05 14:47:28 +0000 |
|---|---|---|
| committer | Benoit Socias <bso@odoo.com> | 2020-11-17 11:41:14 +0000 |
| commit | 1427e54d92e9aa528a1f3fbcc6a29c95e18da971 (patch) | |
| tree | 2bb47fb6ded24a5a7934b4277ed3058556896226 | |
| parent | d652dbb9655d98b4121ac685e6444bbf7e303292 (diff) | |
[IMP] payment, payment_test: missing payment token identifier
Before this commit payment tokens had no name for Test Payment Acquirer
After this commit tokens generated by Test Payment Acquirer have a name
that combines the last 4 digits of the card number and the card account
holder name
https://github.com/odoo/odoo/issues/50965
closes odoo/odoo#61844
X-original-commit: e20f0650acbd1a7a918375a70ec5c89606523a7b
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
| -rw-r--r-- | addons/payment/i18n/payment.pot | 4 | ||||
| -rw-r--r-- | addons/payment/static/src/js/payment_form.js | 8 | ||||
| -rw-r--r-- | addons/payment_test/models/payment_acquirer.py | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/addons/payment/i18n/payment.pot b/addons/payment/i18n/payment.pot index d7e1342de6d..22e7462ce17 100644 --- a/addons/payment/i18n/payment.pot +++ b/addons/payment/i18n/payment.pot @@ -101,7 +101,7 @@ msgstr "" #. openerp-web #: code:addons/payment/static/src/js/payment_form.js:0 #, python-format -msgid "<p>This card is currently linked to the following records:<p/>" +msgid "This card is currently linked to the following records:" msgstr "" #. module: payment @@ -1926,7 +1926,7 @@ msgstr "" #. openerp-web #: code:addons/payment/static/src/js/payment_form.js:0 #, python-format -msgid "We are not able to add your payment method at the moment.</p>" +msgid "We are not able to add your payment method at the moment." msgstr "" #. module: payment diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index e8d6d784cea..59ae4b0e826 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -63,7 +63,7 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({ this.$('#payment_error').remove(); var messageResult = '<div class="alert alert-danger mb4" id="payment_error">'; if (title != '') { - messageResult = messageResult + '<b>' + _.str.escapeHTML(title) + ':</b></br>'; + messageResult = messageResult + '<b>' + _.str.escapeHTML(title) + ':</b><br/>'; } messageResult = messageResult + _.str.escapeHTML(message) + '</div>'; $acquirerForm.append(messageResult); @@ -448,7 +448,7 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({ self.displayError( _t('Server error'), - _t("We are not able to add your payment method at the moment.</p>") + + _t("We are not able to add your payment method at the moment.") + self._parseError(error) ); }); @@ -517,10 +517,10 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({ // if there's records linked to this payment method var content = ''; result[pm_id].forEach(function (sub) { - content += '<p><a href="' + sub.url + '" title="' + sub.description + '">' + sub.name + '</a><p/>'; + content += '<p><a href="' + sub.url + '" title="' + sub.description + '">' + sub.name + '</a></p>'; }); - content = $('<div>').html(_t('<p>This card is currently linked to the following records:<p/>') + content); + content = $('<div>').html('<p>' + _t('This card is currently linked to the following records:') + '</p>' + content); // Then we display the list of the records and ask the user if he really want to remove the payment method. new Dialog(self, { title: _t('Warning!'), diff --git a/addons/payment_test/models/payment_acquirer.py b/addons/payment_test/models/payment_acquirer.py index c569c7a1f07..b9eafcb6f73 100644 --- a/addons/payment_test/models/payment_acquirer.py +++ b/addons/payment_test/models/payment_acquirer.py @@ -31,7 +31,8 @@ class PaymentAcquirerTest(models.Model): payment_token = self.env['payment.token'].sudo().create({ 'acquirer_ref': uuid4(), 'acquirer_id': int(data['acquirer_id']), - 'partner_id': int(data['partner_id']) + 'partner_id': int(data['partner_id']), + 'name': 'XXXXXXXXXXXX%s - %s' % (data['cc_number'][-4:], data['cc_holder_name']) }) return payment_token |
