[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:20:30 +02:00
parent 4488d217dc
commit 9fc63a2751
6 changed files with 65 additions and 4 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ addon | version | maintainers | summary
--- | --- | --- | --- --- | --- | --- | ---
[account_ebics](account_ebics/) | 18.0.1.2.1 | | EBICS banking protocol [account_ebics](account_ebics/) | 18.0.1.2.1 | | EBICS banking protocol
[account_ebics_batch](account_ebics_batch/) | 18.0.1.0.1 | | EBICS Files automated import and processing [account_ebics_batch](account_ebics_batch/) | 18.0.1.0.1 | | EBICS Files automated import and processing
[account_ebics_batch_payment](account_ebics_batch_payment/) | 18.0.1.1.0 | | Upload Batch Payment via EBICS [account_ebics_batch_payment](account_ebics_batch_payment/) | 18.0.1.2.0 | | Upload Batch Payment via EBICS
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 18.0.1.0.1 | | Use OCA Bank Statement Import with account_ebics [account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 18.0.1.0.1 | | Use OCA Bank Statement Import with account_ebics
[account_ebics_oe](account_ebics_oe/) | 18.0.1.0.0 | | Deploy account_ebics module on Odoo Enterprise [account_ebics_oe](account_ebics_oe/) | 18.0.1.0.0 | | Deploy account_ebics module on Odoo Enterprise
[account_ebics_payment_order](account_ebics_payment_order/) | 18.0.1.2.0 | | Upload Payment Order via EBICS [account_ebics_payment_order](account_ebics_payment_order/) | 18.0.1.2.0 | | Upload Payment Order via EBICS
+5 -2
View File
@@ -3,13 +3,16 @@
{ {
"name": "Upload Batch Payment via EBICS", "name": "Upload Batch Payment via EBICS",
"version": "18.0.1.1.0", "version": "18.0.1.2.0",
"license": "LGPL-3", "license": "LGPL-3",
"author": "Noviat", "author": "Noviat",
"website": "https://www.noviat.com/", "website": "https://www.noviat.com/",
"category": "Accounting & Finance", "category": "Accounting & Finance",
"depends": ["account_ebics", "account_batch_payment"], "depends": ["account_ebics", "account_batch_payment"],
"data": ["views/account_batch_payment_views.xml"], "data": [
"views/account_journal_views.xml",
"views/account_batch_payment_views.xml",
],
"installable": True, "installable": True,
"images": ["static/description/cover.png"], "images": ["static/description/cover.png"],
} }
@@ -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_ebics_config_id()
ebics_xfer._onchange_upload_data() 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") view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
act = { act = {
"name": self.env._("EBICS Upload"), "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",
)
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_account_journal_form_ebics_payment_method" model="ir.ui.view">
<field name="name">account.journal.form.ebics.payment.method</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='inbound_payment_method_line_ids']//list"
position="inside"
>
<field
name="ebics_file_format_id"
optional="hide"
options="{'no_create': True}"
/>
</xpath>
<xpath
expr="//field[@name='outbound_payment_method_line_ids']//list"
position="inside"
>
<field
name="ebics_file_format_id"
optional="hide"
options="{'no_create': True}"
/>
</xpath>
</field>
</record>
</odoo>