Merge PR #917 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-04-12 16:55:08 +00:00

View File

@@ -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
)