From 14485aa722ef3aa471ddaf765d3e26b11855c71b Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 5 Aug 2026 12:45:53 +0200 Subject: [PATCH] [IMP] account_ebics_batch_payment: resolve non-searchable field warning Replace `related="ebics_config_id.ebics_file_format_ids"` with an explicit compute method depending on the stored `ebics_config_ids` Many2many, avoiding a dependency chain through the non-searchable computed field `ebics_config_id`. --- account_ebics_batch_payment/models/account_journal.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/account_ebics_batch_payment/models/account_journal.py b/account_ebics_batch_payment/models/account_journal.py index 8106a46..dfddd2e 100644 --- a/account_ebics_batch_payment/models/account_journal.py +++ b/account_ebics_batch_payment/models/account_journal.py @@ -1,7 +1,7 @@ # Copyright 2026 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). -from odoo import fields, models +from odoo import api, fields, models class AccountJournal(models.Model): @@ -9,5 +9,11 @@ class AccountJournal(models.Model): ebics_file_format_ids = fields.Many2many( comodel_name="ebics.file.format", - related="ebics_config_id.ebics_file_format_ids", + compute="_compute_ebics_file_format_ids", ) + + @api.depends("ebics_config_ids.ebics_file_format_ids", "ebics_config_ids.state") + def _compute_ebics_file_format_ids(self): + for rec in self: + config = rec.ebics_config_ids.filtered(lambda r: r.state == "confirm")[:1] + rec.ebics_file_format_ids = config.ebics_file_format_ids