diff --git a/README.md b/README.md index 0608bb3..ad552f7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ addon | version | maintainers | summary --- | --- | --- | --- [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_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_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 diff --git a/account_ebics_batch_payment/__manifest__.py b/account_ebics_batch_payment/__manifest__.py index 91d1b6e..d521467 100644 --- a/account_ebics_batch_payment/__manifest__.py +++ b/account_ebics_batch_payment/__manifest__.py @@ -3,13 +3,16 @@ { "name": "Upload Batch Payment via EBICS", - "version": "18.0.1.1.0", + "version": "18.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", + ], "installable": True, "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 2b22db7..a3c6904 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..771b8bb --- /dev/null +++ b/account_ebics_batch_payment/views/account_journal_views.xml @@ -0,0 +1,30 @@ + + + + account.journal.form.ebics.payment.method + account.journal + + + + + + + + + + +