[IMP] account_ebics_batch_payment: pre-fill EBICS file format from payment method

This commit is contained in:
Luc De Meyer
2026-08-04 18:39:20 +02:00
parent b08c20be60
commit 90b633347e
5 changed files with 64 additions and 3 deletions
@@ -1 +1 @@
from . import account_batch_payment
from . import account_batch_payment, account_payment_method
@@ -49,6 +49,8 @@ class AccountBatchPayment(models.Model):
)
ebics_xfer._onchange_ebics_config_id()
ebics_xfer._onchange_upload_data()
if not ebics_xfer.format_id and self.payment_method_id.ebics_file_format_id:
ebics_xfer.format_id = self.payment_method_id.ebics_file_format_id
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
act = {
"name": self.env._("EBICS Upload"),
@@ -0,0 +1,26 @@
# Copyright 2025 Noviat.
# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl).
from odoo import fields, models
class AccountPaymentMethod(models.Model):
_inherit = "account.payment.method"
ebics_file_format_id = fields.Many2one(
comodel_name="ebics.file.format",
string="EBICS File Format",
help="EBICS file format to pre-select when uploading a batch payment "
"that uses this payment method.",
)
class AccountPaymentMethodLine(models.Model):
_inherit = "account.payment.method.line"
ebics_file_format_id = fields.Many2one(
comodel_name="ebics.file.format",
related="payment_method_id.ebics_file_format_id",
readonly=False,
string="EBICS File Format",
)