mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #365 from akretion/10-better-error
[10.0] Explicit error when bank account is missing on bank journal
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
{
|
||||
'name': 'Account Payment Order',
|
||||
'version': '10.0.1.1.2',
|
||||
'version': '10.0.1.1.3',
|
||||
'license': 'AGPL-3',
|
||||
'author': "ACSONE SA/NV, "
|
||||
"Therp BV, "
|
||||
|
||||
@@ -202,6 +202,12 @@ class AccountPaymentOrder(models.Model):
|
||||
if not order.journal_id:
|
||||
raise UserError(_(
|
||||
'Missing Bank Journal on payment order %s.') % order.name)
|
||||
if (
|
||||
order.payment_method_id.bank_account_required and
|
||||
not order.journal_id.bank_account_id):
|
||||
raise UserError(_(
|
||||
"Missing bank account on bank journal '%s'.")
|
||||
% order.journal_id.display_name)
|
||||
if not order.payment_line_ids:
|
||||
raise UserError(_(
|
||||
'There are no transactions on payment order %s.')
|
||||
|
||||
Reference in New Issue
Block a user