[12.0][FIX] account_banking_pain_base bic constrains

The bic fields is not required, so the constraint must take that into
consideration and accept empty bic.
This commit is contained in:
Thierry Ducrest
2019-03-26 11:29:04 +01:00
committed by Pedro M. Baeza
parent c712fdb819
commit 9d6e99ff87

View File

@@ -22,7 +22,7 @@ class ResBank(models.Model):
:raise: ValidationError if the BIC doesn't respect the regex of the
SEPA pain schemas.
"""
invalid_banks = self.filtered(lambda r: not BIC_REGEX.match(r.bic))
invalid_banks = self.filtered(lambda r: r.bic and not BIC_REGEX.match(r.bic))
if invalid_banks:
raise ValidationError(_(
"The following Bank Identifier Codes (BIC) do not respect "