Issue 11779

Title
IBAN BIC validation fails when bic domestic codes is empty
Priority
bug
Status
testing
Nosy list
ced, pokoli
Assigned to
pokoli
Keywords
backport, review

Created on 2022-10-07.12:14:17 by pokoli, last changed 1 month ago by ced.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-10-07.15:37:06

OK it is probably a bug in schwifty but I think if the BIC has branch_code we should use the version without the branch_code.
Indeed I'm wondering if it is not good that it raise an error because we cannot know if the IBAN is linked to this branch of the bank. So it is probably better to alway link with the national BIC.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-10-07.15:14:34

I filled an issue upstream.
Nevertheless I think we should not raise an error when the list of codes is empty as we do not know if there is something wrong or just some missing data.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-10-07.15:09:49

It fails when using the extended code:

>>> bic = BIC('BSABESBB')
>>> bic
<BIC=BSABESBB>
>>> bic.country_code
'ES'
>>> bic.domestic_bank_codes
['0008', '0013', '0042', '0043', '0046', '0081', '0106', '0112', '0118', '0119', '0185', '0209', '0217', '0230', '0236', '2005', '2076', '2090', '2093', '2102']
>>> bic = BIC('BSABESBBXXX')
>>> bic.domestic_bank_codes
[]
>>> bic = BIC('BSABESBB001')
>>> bic.domestic_bank_codes
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-10-07.14:33:27

Can you identify the cases where the bank is not identified from the BIC?

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-10-07.12:14:16

The swift valdation sometimes returns an empty list for domestic bank codes. In this case the validation always fail because the bic is not present on the empty list.
I think we should skip the bic validation for such case.

Introduced with https://hg.tryton.org/modules/bank/rev/faf70819ff37

History
Date User Action Args
2022-10-07 15:37:06cedsetmessages: + msg78657
2022-10-07 15:14:34pokolisetmessages: + msg78652
2022-10-07 15:09:49pokolisetmessages: + msg78650
2022-10-07 14:33:27cedsetmessages: + msg78639
nosy: + ced
2022-10-07 12:14:39pokolisetkeyword: + review
reviews: 429441003
status: in-progress -> testing
2022-10-07 12:14:17pokolicreate

Showing 10 items. Show all history (warning: this could be VERY long)