diff --git a/README.md b/README.md index edbacd8..a338a4d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ addon | version | maintainers | summary [account_ebics_batch](account_ebics_batch/) | 19.0.1.0.0 | | EBICS Files automated import and processing [account_ebics_batch_payment](account_ebics_batch_payment/) | 19.0.1.1.0 | | Upload Batch Payment via EBICS [account_ebics_oe](account_ebics_oe/) | 19.0.1.0.0 | | Deploy account_ebics module on Odoo Enterprise +[account_ebics_payment_order](account_ebics_payment_order/) | 19.0.1.0.0 | | Upload Payment Order via EBICS [//]: # (end addons) diff --git a/account_ebics_payment_order/README.rst b/account_ebics_payment_order/README.rst new file mode 100644 index 0000000..571a0fc --- /dev/null +++ b/account_ebics_payment_order/README.rst @@ -0,0 +1,28 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl + :alt: License: AGPL-3 + +============================== +Upload Payment Order via EBICS +============================== + +This module allows to upload a Payment Order to the bank via the EBICS protocol. + +Installation +============ + +This module depends upon the following modules (cf. apps.odoo.com): + +- account_ebics +- account_payment_order + +Configuration +============= + +Set the EBICS File Format on your Payment Modes. + +Usage +===== + +Create your Payment Order and generate the bank file. +Upload the generated file via the 'EBICS Upload' button on the payment order. diff --git a/account_ebics_payment_order/__init__.py b/account_ebics_payment_order/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/account_ebics_payment_order/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_ebics_payment_order/__manifest__.py b/account_ebics_payment_order/__manifest__.py new file mode 100644 index 0000000..14eeabe --- /dev/null +++ b/account_ebics_payment_order/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2015 Noviat. +# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl). + +{ + "name": "Upload Payment Order via EBICS", + "version": "19.0.1.0.0", + "license": "LGPL-3", + "author": "Noviat", + "website": "https://www.noviat.com/", + "category": "Accounting & Finance", + "depends": ["account_ebics", "account_payment_order"], + "data": [ + "views/account_payment_order_views.xml", + "views/account_payment_mode_views.xml", + ], + "images": ["static/description/cover.png"], +} diff --git a/account_ebics_payment_order/i18n/account_ebics_payment_order.pot b/account_ebics_payment_order/i18n/account_ebics_payment_order.pot new file mode 100644 index 0000000..c737ddc --- /dev/null +++ b/account_ebics_payment_order/i18n/account_ebics_payment_order.pot @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_ebics_payment_order +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.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_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__display_name +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__display_name +msgid "Display Name" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "EBICS File Format" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model_terms:ir.ui.view,arch_db:account_ebics_payment_order.account_payment_order_form +msgid "EBICS Upload" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__hide_ebics_upload +msgid "Hide Ebics Upload" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__id +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__id +msgid "ID" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "Missing EBICS File Format setting on your Payment Mode." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "No active EBICS configuration available for the selected bank." +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,help:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "Select EBICS File Format to upload." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order contains multiple attachments.\n" +"Please remove the obsolete attachments or upload the payment order file via the EBICS Processing > EBICS Upload menu" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order doesn't contains attachments.\n" +"Please generate first the Payment Order file." +msgstr "" diff --git a/account_ebics_payment_order/i18n/fr.po b/account_ebics_payment_order/i18n/fr.po new file mode 100644 index 0000000..fa81f56 --- /dev/null +++ b/account_ebics_payment_order/i18n/fr.po @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_ebics_payment_order +# +# Weblate Translation Memory , 2026. +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-06-10 02:54+0000\n" +"Last-Translator: Weblate Translation Memory \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.15.1\n" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__display_name +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__display_name +msgid "Display Name" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "EBICS File Format" +msgstr "Format de fichier EBICS" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model_terms:ir.ui.view,arch_db:account_ebics_payment_order.account_payment_order_form +msgid "EBICS Upload" +msgstr "Téléversement EBICS" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__hide_ebics_upload +msgid "Hide Ebics Upload" +msgstr "Masquer le téléversement Ebics" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__id +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__id +msgid "ID" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "Missing EBICS File Format setting on your Payment Mode." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "No active EBICS configuration available for the selected bank." +msgstr "" +"Aucune configuration EBICS active disponible pour la banque sélectionnée." + +#. module: account_ebics_payment_order +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,help:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "Select EBICS File Format to upload." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order contains multiple attachments.\n" +"Please remove the obsolete attachments or upload the payment order file via " +"the EBICS Processing > EBICS Upload menu" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order doesn't contains attachments.\n" +"Please generate first the Payment Order file." +msgstr "" diff --git a/account_ebics_payment_order/i18n/nl.po b/account_ebics_payment_order/i18n/nl.po new file mode 100644 index 0000000..75703c9 --- /dev/null +++ b/account_ebics_payment_order/i18n/nl.po @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_ebics_payment_order +# +# Weblate Translation Memory , 2026. +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-06-10 02:54+0000\n" +"Last-Translator: Weblate Translation Memory \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.1\n" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__display_name +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__display_name +msgid "Display Name" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "EBICS File Format" +msgstr "EBICS-bestandsformaat" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model_terms:ir.ui.view,arch_db:account_ebics_payment_order.account_payment_order_form +msgid "EBICS Upload" +msgstr "EBICS-upload" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__hide_ebics_upload +msgid "Hide Ebics Upload" +msgstr "Ebics-upload verbergen" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_mode__id +#: model:ir.model.fields,field_description:account_ebics_payment_order.field_account_payment_order__id +msgid "ID" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "Missing EBICS File Format setting on your Payment Mode." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "No active EBICS configuration available for the selected bank." +msgstr "" +"Geen actieve EBICS-configuratie beschikbaar voor de geselecteerde bank." + +#. module: account_ebics_payment_order +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +#: model:ir.model,name:account_ebics_payment_order.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_ebics_payment_order +#: model:ir.model.fields,help:account_ebics_payment_order.field_account_payment_mode__ebics_format_id +msgid "Select EBICS File Format to upload." +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order contains multiple attachments.\n" +"Please remove the obsolete attachments or upload the payment order file via " +"the EBICS Processing > EBICS Upload menu" +msgstr "" + +#. module: account_ebics_payment_order +#. odoo-python +#: code:addons/account_ebics_payment_order/models/account_payment_order.py:0 +msgid "" +"This payment order doesn't contains attachments.\n" +"Please generate first the Payment Order file." +msgstr "" diff --git a/account_ebics_payment_order/models/__init__.py b/account_ebics_payment_order/models/__init__.py new file mode 100644 index 0000000..72b2653 --- /dev/null +++ b/account_ebics_payment_order/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_payment_mode +from . import account_payment_order diff --git a/account_ebics_payment_order/models/account_payment_mode.py b/account_ebics_payment_order/models/account_payment_mode.py new file mode 100644 index 0000000..055fbf4 --- /dev/null +++ b/account_ebics_payment_order/models/account_payment_mode.py @@ -0,0 +1,15 @@ +# Copyright 2015 Noviat. +# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class AccountPaymentMode(models.Model): + _inherit = "account.payment.mode" + + ebics_format_id = fields.Many2one( + comodel_name="ebics.file.format", + string="EBICS File Format", + domain="[('type', '=', 'up')]", + help="Select EBICS File Format to upload.", + ) diff --git a/account_ebics_payment_order/models/account_payment_order.py b/account_ebics_payment_order/models/account_payment_order.py new file mode 100644 index 0000000..c28aa65 --- /dev/null +++ b/account_ebics_payment_order/models/account_payment_order.py @@ -0,0 +1,90 @@ +# Copyright 2015 Noviat. +# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models +from odoo.exceptions import UserError + + +class AccountPaymentOrder(models.Model): + _inherit = "account.payment.order" + + hide_ebics_upload = fields.Boolean( + compute="_compute_hide_ebics_upload", default=True + ) + + @api.depends("journal_id.ebics_config_id", "state") + def _compute_hide_ebics_upload(self): + for rec in self: + rec.hide_ebics_upload = ( + not rec.journal_id.ebics_config_id or rec.state != "generated" + ) + + def ebics_upload(self): + self.ensure_one() + ctx = self.env.context.copy() + ebics_format_id = self.payment_mode_id.ebics_format_id + if not ebics_format_id: + raise UserError( + self.env._("Missing EBICS File Format setting on your Payment Mode.") + ) + ctx.update( + { + "active_model": self._name, + "default_format_id": ebics_format_id.id, + } + ) + attach = self.env["ir.attachment"].search( + [("res_model", "=", self._name), ("res_id", "=", self.id)] + ) + if not attach: + raise UserError( + self.env._( + "This payment order doesn't contains attachments." + "\nPlease generate first the Payment Order file." + ) + ) + elif len(attach) > 1: + raise UserError( + self.env._( + "This payment order contains multiple attachments." + "\nPlease remove the obsolete attachments or upload " + "the payment order file via the " + "EBICS Processing > EBICS Upload menu" + ) + ) + else: + origin = self.env._("Payment Order") + ": " + self.name + if not self.journal_id.ebics_config_id: + raise UserError( + self.env._( + "No active EBICS configuration available for the selected bank." + ) + ) + ctx.update( + { + "default_ebics_config_id": self.journal_id.ebics_config_id.id, + "default_upload_data": attach.datas, + "default_upload_fname": attach.name, + "origin": origin, + } + ) + ebics_xfer = ( + self.env["ebics.xfer"] + .with_company(self.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_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_payment_order/pyproject.toml b/account_ebics_payment_order/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/account_ebics_payment_order/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_ebics_payment_order/static/description/cover.png b/account_ebics_payment_order/static/description/cover.png new file mode 100644 index 0000000..41c4cec Binary files /dev/null and b/account_ebics_payment_order/static/description/cover.png differ diff --git a/account_ebics_payment_order/static/description/icon.png b/account_ebics_payment_order/static/description/icon.png new file mode 100644 index 0000000..889d129 Binary files /dev/null and b/account_ebics_payment_order/static/description/icon.png differ diff --git a/account_ebics_payment_order/static/description/index.html b/account_ebics_payment_order/static/description/index.html new file mode 100644 index 0000000..05adec8 --- /dev/null +++ b/account_ebics_payment_order/static/description/index.html @@ -0,0 +1,389 @@ + + + + + +README.rst + + + +
+ + +License: AGPL-3 +
+

Upload Payment Order via EBICS

+

This module allows to upload a Payment Order to the bank via the EBICS protocol.

+
+

Installation

+

This module depends upon the following modules (cf. apps.odoo.com):

+
    +
  • account_ebics
  • +
  • account_payment_order
  • +
+
+
+

Configuration

+

Set the EBICS File Format on your Payment Modes.

+
+
+

Usage

+

Create your Payment Order and generate the bank file. +Upload the generated file via the 'EBICS Upload' button on the payment order.

+
+
+
+ + diff --git a/account_ebics_payment_order/views/account_payment_mode_views.xml b/account_ebics_payment_order/views/account_payment_mode_views.xml new file mode 100644 index 0000000..db9d9b6 --- /dev/null +++ b/account_ebics_payment_order/views/account_payment_mode_views.xml @@ -0,0 +1,13 @@ + + + + account.payment.mode.form + account.payment.mode + + + + + + + + diff --git a/account_ebics_payment_order/views/account_payment_order_views.xml b/account_ebics_payment_order/views/account_payment_order_views.xml new file mode 100644 index 0000000..3e2bf7e --- /dev/null +++ b/account_ebics_payment_order/views/account_payment_order_views.xml @@ -0,0 +1,22 @@ + + + + account.payment.order.form + account.payment.order + + + + + +