mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
FIX account_bank_statement_import_camt error message and comment
This commit is contained in:
@@ -220,14 +220,14 @@ class CamtParser(models.AbstractModel):
|
|||||||
r'|^ISO:camt.052.)'
|
r'|^ISO:camt.052.)'
|
||||||
)
|
)
|
||||||
if not re_camt_version.search(ns):
|
if not re_camt_version.search(ns):
|
||||||
raise ValueError('no camt 052 or 053: ' + ns)
|
raise ValueError('no camt 052 or 053 or 054: ' + ns)
|
||||||
# Check GrpHdr element:
|
# Check GrpHdr element:
|
||||||
root_0_0 = root[0][0].tag[len(ns) + 2:] # strip namespace
|
root_0_0 = root[0][0].tag[len(ns) + 2:] # strip namespace
|
||||||
if root_0_0 != 'GrpHdr':
|
if root_0_0 != 'GrpHdr':
|
||||||
raise ValueError('expected GrpHdr, got: ' + root_0_0)
|
raise ValueError('expected GrpHdr, got: ' + root_0_0)
|
||||||
|
|
||||||
def parse(self, data):
|
def parse(self, data):
|
||||||
"""Parse a camt.052 or camt.053 file."""
|
"""Parse a camt.052 or camt.053 or camt.054 file."""
|
||||||
try:
|
try:
|
||||||
root = etree.fromstring(
|
root = etree.fromstring(
|
||||||
data, parser=etree.XMLParser(recover=True))
|
data, parser=etree.XMLParser(recover=True))
|
||||||
|
|||||||
Reference in New Issue
Block a user