mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-08-06 22:52:36 +00:00
[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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user