From 1246590592653eff9d440b671d4da2afe98aee23 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 5 Aug 2026 10:10:48 +0200 Subject: [PATCH] [IMP] account_ebics_batch_payment: restrict EBICS file format domain to upload formats defined in EBICS config --- account_ebics_batch_payment/models/__init__.py | 2 +- .../models/account_journal.py | 13 +++++++++++++ .../views/account_journal_views.xml | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 account_ebics_batch_payment/models/account_journal.py diff --git a/account_ebics_batch_payment/models/__init__.py b/account_ebics_batch_payment/models/__init__.py index b9b458f..697c293 100644 --- a/account_ebics_batch_payment/models/__init__.py +++ b/account_ebics_batch_payment/models/__init__.py @@ -1 +1 @@ -from . import account_batch_payment, account_payment_method +from . import account_batch_payment, account_journal, account_payment_method diff --git a/account_ebics_batch_payment/models/account_journal.py b/account_ebics_batch_payment/models/account_journal.py new file mode 100644 index 0000000..8106a46 --- /dev/null +++ b/account_ebics_batch_payment/models/account_journal.py @@ -0,0 +1,13 @@ +# Copyright 2026 Noviat. +# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + ebics_file_format_ids = fields.Many2many( + comodel_name="ebics.file.format", + related="ebics_config_id.ebics_file_format_ids", + ) diff --git a/account_ebics_batch_payment/views/account_journal_views.xml b/account_ebics_batch_payment/views/account_journal_views.xml index a3951c2..d6cbf2c 100644 --- a/account_ebics_batch_payment/views/account_journal_views.xml +++ b/account_ebics_batch_payment/views/account_journal_views.xml @@ -13,6 +13,7 @@ name="ebics_file_format_id" optional="hide" options="{'no_create': True}" + domain="[('id', 'in', parent.ebics_file_format_ids), ('type', '=', 'up')]" />