[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`.
This commit is contained in:
Luc De Meyer
2026-08-05 12:51:54 +02:00
parent 1246590592
commit 14485aa722
@@ -1,7 +1,7 @@
# Copyright 2026 Noviat. # Copyright 2026 Noviat.
# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). # 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): class AccountJournal(models.Model):
@@ -9,5 +9,11 @@ class AccountJournal(models.Model):
ebics_file_format_ids = fields.Many2many( ebics_file_format_ids = fields.Many2many(
comodel_name="ebics.file.format", 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