[FIX] account_ebics - Explain missing journal in EBICS key initialisation

ebics_init_1 read journal_ids[0] before checking it, so a configuration
without journal raised an IndexError instead of the "No bank defined"
message.
This commit is contained in:
Jérémy Didderen committed 2026-10-27 21:38:40 +01:00
1 parent b0e1b053e9
commit 8c7484acbf
1 file changed
+1 -2
+1 -2
View File
@@ -413,7 +413,7 @@ class EbicsUserID(models.Model):
raise UserError(error) from err raise UserError(error) from err
# Send the public electronic signature key to the bank. # Send the public electronic signature key to the bank.
ebics_config_bank = self.ebics_config_id.journal_ids[0].bank_id ebics_config_bank = self.ebics_config_id.journal_ids[:1].bank_id
if not ebics_config_bank: if not ebics_config_bank:
raise UserError( raise UserError(
self.env._( self.env._(
@@ -471,7 +471,6 @@ class EbicsUserID(models.Model):
self.ebics_config_id._update_order_number(OrderID) self.ebics_config_id._update_order_number(OrderID)
# Create an INI-letter which must be printed and sent to the bank. # Create an INI-letter which must be printed and sent to the bank.
ebics_config_bank = self.ebics_config_id.journal_ids[0].bank_id
cc = ebics_config_bank.country.code cc = ebics_config_bank.country.code
if cc in ["FR", "DE"]: if cc in ["FR", "DE"]:
lang = cc lang = cc