From c80a32f9df288f3bc227f0e68d9b3304a0444544 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Mon, 22 May 2017 09:43:19 +0200 Subject: [PATCH] [FIX] payment: untranslated message Without this the error message will always be in English, no matter the language of the end-user. Closes #17141 --- addons/payment/i18n/payment.pot | 8 +++++++- addons/payment/models/account_payment.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/payment/i18n/payment.pot b/addons/payment/i18n/payment.pot index f518a5b1d83..86aa85cd777 100644 --- a/addons/payment/i18n/payment.pot +++ b/addons/payment/i18n/payment.pot @@ -805,6 +805,13 @@ msgstr "" msgid "The payment transaction reference must be unique!" msgstr "" +#. module: payment +#: code:addons/payment/models/account_payment.py:43 +#, python-format +msgid "This feature is not available for payment acquirers set to the "Authorize" mode.\n" +"Please use a token from another provider than %s." +msgstr "" + #. module: payment #: model:ir.model.fields,help:payment.field_payment_acquirer_image msgid "This field holds the image used for this provider, limited to 1024x1024px" @@ -961,4 +968,3 @@ msgstr "" #: model:ir.ui.view,arch_db:payment.acquirer_form msgid "user: current user browse record" msgstr "" - diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index d507666f35f..60ddcc60b4d 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -39,8 +39,8 @@ class AccountPayment(models.Model): def _do_payment(self): if self.payment_token_id.acquirer_id.auto_confirm == 'authorize': - raise ValidationError('This feature is not available for payment acquirers set to the "Authorize" mode.\n' - 'Please use a token from another provider than %s.' % self.payment_token_id.acquirer_id.name) + raise ValidationError(_('This feature is not available for payment acquirers set to the "Authorize" mode.\n' + 'Please use a token from another provider than %s.') % self.payment_token_id.acquirer_id.name) reference = "P-%s-%s" % (self.id, datetime.datetime.now().strftime('%y%m%d_%H%M%S')) tx = self.env['payment.transaction'].create({ 'amount': self.amount,