Skip to content

Commit

Permalink
[FIX] payment: manual acquirer
Browse files Browse the repository at this point in the history
Raise an error if no manual acquirer could be found for the current
company instead of crashing.

opw-1915813
opw-1917979

closes #29608
  • Loading branch information
nim-odoo committed Dec 18, 2018
1 parent 7618f84 commit 16c1c89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/payment/i18n/payment.pot
Expand Up @@ -1007,6 +1007,12 @@ msgstr ""
msgid "Never"
msgstr ""

#. module: payment
#: code:addons/payment/wizards/payment_acquirer_onboarding_wizard.py:127
#, python-format
msgid "No manual payment method could be found for this company. Please create one from the Payment Acquirer menu."
msgstr ""

#. module: payment
#: model_terms:ir.ui.view,arch_db:payment.pay
msgid "No payment acquirer found."
Expand Down
5 changes: 5 additions & 0 deletions addons/payment/wizards/payment_acquirer_onboarding_wizard.py
Expand Up @@ -123,6 +123,11 @@ def add_payment_methods(self):
})
if self.payment_method == 'manual':
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. ' +
'Please create one from the Payment Acquirer menu.'
))
manual_acquirer.name = self.manual_name
manual_acquirer.post_msg = self.manual_post_msg
manual_acquirer.website_published = True
Expand Down

0 comments on commit 16c1c89

Please sign in to comment.