From a5d8a3bf3e9b287c5b9c34e12199f47d43ad695f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 12 Apr 2022 14:59:51 +0200 Subject: [PATCH] [FIX] account_banking_sepa_direct_debit: Remove warnings in tests. TT35948 --- .../models/account_banking_mandate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/account_banking_sepa_direct_debit/models/account_banking_mandate.py b/account_banking_sepa_direct_debit/models/account_banking_mandate.py index 6b98c7624..744a5de81 100644 --- a/account_banking_sepa_direct_debit/models/account_banking_mandate.py +++ b/account_banking_sepa_direct_debit/models/account_banking_mandate.py @@ -6,7 +6,8 @@ from datetime import datetime from dateutil.relativedelta import relativedelta -from odoo import _, api, exceptions, fields, models +from odoo import _, api, fields, models +from odoo.exceptions import UserError NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36 @@ -50,7 +51,7 @@ class AccountBankingMandate(models.Model): def _check_recurring_type(self): for mandate in self: if mandate.type == "recurrent" and not mandate.recurrent_sequence_type: - raise exceptions.Warning( + raise UserError( _("The recurrent mandate '%s' must have a sequence type.") % mandate.unique_mandate_reference )