mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] Explicit error when bank account is missing on bank journal
This commit is contained in:
committed by
Enric Tobella
parent
fce7b19800
commit
7375fc6698
@@ -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