diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8445d64..8800e5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -101,7 +101,7 @@ repos: args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/OCA/pylint-odoo - rev: v9.0.4 + rev: v9.1.3 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/account_ebics/models/account_bank_statement.py b/account_ebics/models/account_bank_statement.py index 89c5eaf..1ae0bbf 100644 --- a/account_ebics/models/account_bank_statement.py +++ b/account_ebics/models/account_bank_statement.py @@ -1,4 +1,4 @@ -# Copyright 2009-2023 Noviat. +# Copyright 2009-2024 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models diff --git a/account_ebics/models/fintech_ebics_register.py b/account_ebics/models/fintech_ebics_register.py index ed6be8e..dc218f5 100644 --- a/account_ebics/models/fintech_ebics_register.py +++ b/account_ebics/models/fintech_ebics_register.py @@ -1,4 +1,4 @@ -# Copyright 2009-2020 Noviat. +# Copyright 2009-2024 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). import logging diff --git a/account_ebics/wizards/ebics_admin_order.py b/account_ebics/wizards/ebics_admin_order.py index 8d4b9a9..0825491 100644 --- a/account_ebics/wizards/ebics_admin_order.py +++ b/account_ebics/wizards/ebics_admin_order.py @@ -1,4 +1,4 @@ -# Copyright 2009-2023 Noviat. +# Copyright 2009-2024 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). import pprint diff --git a/account_ebics_batch_payment/README.rst b/account_ebics_batch_payment/README.rst new file mode 100644 index 0000000..af159d4 --- /dev/null +++ b/account_ebics_batch_payment/README.rst @@ -0,0 +1,24 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl + :alt: License: AGPL-3 + +============================== +Upload Batch Payment via EBICS +============================== + +This module allows to upload a Batch Payment to the bank via the EBICS protocol. + +Installation +============ + +This module depends upon the following modules: + +- account_ebics (cf. https://github.com/Noviat/account_ebics) +- account_ebics_oe (cf. https://github.com/Noviat/account_ebics) +- account_batch_payment (Odoo Enterprise) + +Usage +===== + +Create your Batch Payment and generate the bank file. +Upload the generated file via the 'EBICS Upload' button on the batch payment. diff --git a/account_ebics_batch_payment/__init__.py b/account_ebics_batch_payment/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/account_ebics_batch_payment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_ebics_batch_payment/__manifest__.py b/account_ebics_batch_payment/__manifest__.py new file mode 100644 index 0000000..8c47326 --- /dev/null +++ b/account_ebics_batch_payment/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2009-2024 Noviat. +# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). + +{ + "name": "Upload Batch Payment via EBICS", + "version": "18.0.1.0.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"], + "installable": True, + "images": ["static/description/cover.png"], +} diff --git a/account_ebics_batch_payment/i18n/account_ebics_batch_payment.pot b/account_ebics_batch_payment/i18n/account_ebics_batch_payment.pot new file mode 100644 index 0000000..312563f --- /dev/null +++ b/account_ebics_batch_payment/i18n/account_ebics_batch_payment.pot @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_ebics_batch_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0+e\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_ebics_batch_payment +#. odoo-python +#: code:addons/account_ebics_batch_payment/models/account_batch_payment.py:0 +#: model:ir.model,name:account_ebics_batch_payment.model_account_batch_payment +#, python-format +msgid "Batch Payment" +msgstr "" + +#. module: account_ebics_batch_payment +#. odoo-python +#: code:addons/account_ebics_batch_payment/models/account_batch_payment.py:0 +#: model_terms:ir.ui.view,arch_db:account_ebics_batch_payment.view_batch_payment_form +#, python-format +msgid "EBICS Upload" +msgstr "" + +#. module: account_ebics_batch_payment +#. odoo-python +#: code:addons/account_ebics_batch_payment/models/account_batch_payment.py:0 +#, python-format +msgid "No active EBICS configuration available for the selected bank." +msgstr "" diff --git a/account_ebics_batch_payment/models/__init__.py b/account_ebics_batch_payment/models/__init__.py new file mode 100644 index 0000000..015ee74 --- /dev/null +++ b/account_ebics_batch_payment/models/__init__.py @@ -0,0 +1 @@ +from . import account_batch_payment diff --git a/account_ebics_batch_payment/models/account_batch_payment.py b/account_ebics_batch_payment/models/account_batch_payment.py new file mode 100644 index 0000000..dbb4ae6 --- /dev/null +++ b/account_ebics_batch_payment/models/account_batch_payment.py @@ -0,0 +1,58 @@ +# Copyright 2009-2024 Noviat. +# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import models +from odoo.exceptions import UserError + + +class AccountBatchPayment(models.Model): + _inherit = "account.batch.payment" + + def ebics_upload(self): + self.ensure_one() + ctx = self.env.context.copy() + + origin = self.env._("Batch Payment") + ": " + self.name + ebics_config = self.env["ebics.config"].search( + [ + ("journal_ids", "=", self.journal_id.id), + ("state", "=", "confirm"), + ] + ) + if not ebics_config: + raise UserError( + self.env._( + "No active EBICS configuration available for the selected bank." + ) + ) + if len(ebics_config) == 1: + ctx["default_ebics_config_id"] = ebics_config.id + ctx.update( + { + "default_upload_data": self.export_file, + "default_upload_fname": self.export_filename, + "origin": origin, + } + ) + + ebics_xfer = ( + self.env["ebics.xfer"] + .with_company(self.journal_id.company_id) + .with_context(**ctx) + .create({}) + ) + ebics_xfer._onchange_ebics_config_id() + ebics_xfer._onchange_upload_data() + view = self.env.ref("account_ebics.ebics_xfer_view_form_upload") + act = { + "name": self.env._("EBICS Upload"), + "view_type": "form", + "view_mode": "form", + "res_model": "ebics.xfer", + "view_id": view.id, + "res_id": ebics_xfer.id, + "type": "ir.actions.act_window", + "target": "new", + "context": ctx, + } + return act diff --git a/account_ebics_batch_payment/pyproject.toml b/account_ebics_batch_payment/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/account_ebics_batch_payment/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_ebics_batch_payment/static/description/cover.png b/account_ebics_batch_payment/static/description/cover.png new file mode 100644 index 0000000..41c4cec Binary files /dev/null and b/account_ebics_batch_payment/static/description/cover.png differ diff --git a/account_ebics_batch_payment/static/description/icon.png b/account_ebics_batch_payment/static/description/icon.png new file mode 100644 index 0000000..889d129 Binary files /dev/null and b/account_ebics_batch_payment/static/description/icon.png differ diff --git a/account_ebics_batch_payment/static/description/index.html b/account_ebics_batch_payment/static/description/index.html new file mode 100644 index 0000000..c565c28 --- /dev/null +++ b/account_ebics_batch_payment/static/description/index.html @@ -0,0 +1,386 @@ + + +
+ + +This module allows to upload a Batch Payment to the bank via the EBICS protocol.
+This module depends upon the following modules:
+Create your Batch Payment and generate the bank file. +Upload the generated file via the 'EBICS Upload' button on the batch payment.
+