mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_banking_sepa_direct_debit: Rise exception if the mandate type is not correct
Closes #600
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# Copyright 2018 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
from lxml import etree
|
||||
|
||||
@@ -81,6 +81,11 @@ class AccountPaymentOrder(models.Model):
|
||||
seq_type_label = line.mandate_id.recurrent_sequence_type
|
||||
assert seq_type_label is not False
|
||||
seq_type = seq_type_map[seq_type_label]
|
||||
else:
|
||||
raise exceptions.UserError(_(
|
||||
"Invalid mandate type in '%s'. Valid ones are 'Recurrent' "
|
||||
"or 'One-Off'"
|
||||
) % line.mandate_id.unique_mandate_reference)
|
||||
# The field line.date is the requested payment date
|
||||
# taking into account the 'date_preferred' setting
|
||||
# cf account_banking_payment_export/models/account_payment.py
|
||||
|
||||
Reference in New Issue
Block a user