From 2c3f313ebebfed5bb445986f5890e8a3441dc141 Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Tue, 26 Mar 2019 11:29:04 +0100 Subject: [PATCH] [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. --- account_banking_pain_base/models/res_bank.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/res_bank.py b/account_banking_pain_base/models/res_bank.py index 3713735c8..efdc95903 100644 --- a/account_banking_pain_base/models/res_bank.py +++ b/account_banking_pain_base/models/res_bank.py @@ -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 "