summaryrefslogtreecommitdiff
path: root/addons/payment
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-06-26 07:21:33 +0000
committerMartin Trigaux <mat@odoo.com>2020-06-30 10:19:59 +0000
commit400cc4f14ed12bce8d11ea515041253a9271f5a5 (patch)
treee62f8e54acf97e42325114844494b4b82fc99a07 /addons/payment
parent241f06d868296f6e2ef851d6f5d156f59f630b00 (diff)
[FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint gettext-variable test. It converts some calls to the new syntax _("Foo %s", bar) to progressively migrate the code to the new syntax. A few calls were not technically incorrect but still detected by the linter. _("Foo" + "Bar") has been converted to _("Foo" "Bar") as it has the same effect and make sure the argument is of type asteroid.Const instead of BinOp). closes odoo/odoo#53683 Related: odoo/enterprise#11467 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/payment')
-rw-r--r--addons/payment/models/account_invoice.py2
-rw-r--r--addons/payment/models/payment_acquirer.py2
-rw-r--r--addons/payment/wizards/payment_acquirer_onboarding_wizard.py12
3 files changed, 10 insertions, 6 deletions
diff --git a/addons/payment/models/account_invoice.py b/addons/payment/models/account_invoice.py
index 882a25b6279..ef1bba210eb 100644
--- a/addons/payment/models/account_invoice.py
+++ b/addons/payment/models/account_invoice.py
@@ -67,7 +67,7 @@ class AccountMove(models.Model):
# Check a journal is set on acquirer.
if not acquirer.journal_id:
- raise ValidationError(_('A journal must be specified of the acquirer %s.' % acquirer.name))
+ raise ValidationError(_('A journal must be specified of the acquirer %s.', acquirer.name))
if not acquirer_id and acquirer:
vals['acquirer_id'] = acquirer.id
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 2e605b71b0a..c4b20bac604 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -951,7 +951,7 @@ class PaymentTransaction(models.Model):
def _check_authorize_state(self):
failed_tx = self.filtered(lambda tx: tx.state == 'authorized' and tx.acquirer_id.provider not in self.env['payment.acquirer']._get_feature_support()['authorize'])
if failed_tx:
- raise exceptions.ValidationError(_('The %s payment acquirers are not allowed to manual capture mode!' % failed_tx.mapped('acquirer_id.name')))
+ raise exceptions.ValidationError(_('The %s payment acquirers are not allowed to manual capture mode!', failed_tx.mapped('acquirer_id.name')))
@api.model
def create(self, values):
diff --git a/addons/payment/wizards/payment_acquirer_onboarding_wizard.py b/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
index 5f925e1b47a..2a9a90cc52e 100644
--- a/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
+++ b/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
@@ -35,8 +35,12 @@ class PaymentWizard(models.TransientModel):
@api.onchange('journal_name', 'acc_number')
def _set_manual_post_msg_value(self):
- self.manual_post_msg = _('<h3>Please make a payment to: </h3><ul><li>Bank: %s</li><li>Account Number: %s</li><li>Account Holder: %s</li></ul>') %\
- (self.journal_name or _("Bank") , self.acc_number or _("Account"), self.env.company.name)
+ self.manual_post_msg = _(
+ '<h3>Please make a payment to: </h3><ul><li>Bank: %s</li><li>Account Number: %s</li><li>Account Holder: %s</li></ul>',
+ self.journal_name or _("Bank"),
+ self.acc_number or _("Account"),
+ self.env.company.name
+ )
_payment_acquirer_onboarding_cache = {}
@@ -128,7 +132,7 @@ class PaymentWizard(models.TransientModel):
manual_acquirer = self._get_manual_payment_acquirer(new_env)
if not manual_acquirer:
raise UserError(_(
- 'No manual payment method could be found for this company. ' +
+ 'No manual payment method could be found for this company. '
'Please create one from the Payment Acquirer menu.'
))
manual_acquirer.name = self.manual_name
@@ -140,7 +144,7 @@ class PaymentWizard(models.TransientModel):
journal.name = self.journal_name
journal.bank_acc_number = self.acc_number
else:
- raise UserError(_("You have to set a journal for your payment acquirer %s." % (self.manual_name,)))
+ raise UserError(_("You have to set a journal for your payment acquirer %s.", self.manual_name))
# delete wizard data immediately to get rid of residual credentials
self.sudo().unlink()