Skip to content

[FIX] account_ebics: camt.054 without account currency - #180

Open
ecino wants to merge 1 commit into
Noviat:18.0from
CompassionCH:18.0-fix-camt054-currency
Open

ecino wants to merge 1 commit into
Noviat:18.0from
CompassionCH:18.0-fix-camt054-currency

Conversation

@ecino

@ecino ecino commented Oct 7, 2026 •

Copy link
Copy Markdown

camt.054 notifications (e.g. from Raiffeisen) contain neither Acct/Ccy nor Bal, so the currency lookup in _split_camt returns an empty list and the import crashes:

File "account_ebics/models/ebics_file.py", line 589, in _split_camt
    currency_code = stmt.xpath(
IndexError: list index out of range

This change:

  • falls back on the currency of the entries (Ntry/Amt/@Ccy) when neither the account currency nor a balance is present. XPath returns nodes in document order, so Acct/Ccy and Bal still take precedence for camt.053;
  • adds an error notification and skips the statement, instead of crashing, when no currency can be found at all.

camt.054 notifications (e.g. Raiffeisen) have neither Acct/Ccy nor Bal,
which raised an IndexError in _split_camt. Fall back on the currency of
the entries and add a notification instead of crashing when no currency
is found.

Assisted-by: claude-opus-5-5, medium, claude-code
@luc-demeyer

Copy link
Copy Markdown
Contributor

@ecino
Thanks for this nice contribution.
I analyzed your PR and took a slightly different approach for this issue, cf. #181
Can you have a look and test this fix with your camt.054 file ?
I'll merge the code once I receive a positive feedback from you and forward port it to account_ebics for Odoo 19.0 and 20.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants