diff --git a/account_ebics_batch_payment/__manifest__.py b/account_ebics_batch_payment/__manifest__.py index 1aaf0d6..475b4d1 100644 --- a/account_ebics_batch_payment/__manifest__.py +++ b/account_ebics_batch_payment/__manifest__.py @@ -3,12 +3,15 @@ { "name": "Upload Batch Payment via EBICS", - "version": "19.0.1.1.0", + "version": "19.0.1.2.0", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", "category": "Accounting & Finance", "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", + ], "images": ["static/description/cover.png"], } diff --git a/account_ebics_batch_payment/models/__init__.py b/account_ebics_batch_payment/models/__init__.py index 015ee74..b9b458f 100644 --- a/account_ebics_batch_payment/models/__init__.py +++ b/account_ebics_batch_payment/models/__init__.py @@ -1 +1 @@ -from . import account_batch_payment +from . import account_batch_payment, account_payment_method diff --git a/account_ebics_batch_payment/models/account_batch_payment.py b/account_ebics_batch_payment/models/account_batch_payment.py index 07bb8a1..f6eecf9 100644 --- a/account_ebics_batch_payment/models/account_batch_payment.py +++ b/account_ebics_batch_payment/models/account_batch_payment.py @@ -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"), diff --git a/account_ebics_batch_payment/models/account_payment_method.py b/account_ebics_batch_payment/models/account_payment_method.py new file mode 100644 index 0000000..bc08356 --- /dev/null +++ b/account_ebics_batch_payment/models/account_payment_method.py @@ -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", + ) diff --git a/account_ebics_batch_payment/views/account_journal_views.xml b/account_ebics_batch_payment/views/account_journal_views.xml new file mode 100644 index 0000000..a3951c2 --- /dev/null +++ b/account_ebics_batch_payment/views/account_journal_views.xml @@ -0,0 +1,30 @@ + + + + account.journal.form.ebics.payment.method + account.journal + + + + + + + + + + +