From f62ef38ed86ed24d17260bee1d4b90d093ce6b56 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 28 May 2023 22:12:47 +0200 Subject: [PATCH] [16.0]add support for some administrative order types --- account_ebics/README.rst | 1 + account_ebics/__manifest__.py | 3 +- account_ebics/security/ir.model.access.csv | 1 + account_ebics/static/description/index.html | 1 + account_ebics/views/menu.xml | 9 +++ account_ebics/wizards/__init__.py | 1 + account_ebics/wizards/ebics_admin_order.py | 53 ++++++++++++++++++ account_ebics/wizards/ebics_admin_order.xml | 61 +++++++++++++++++++++ account_ebics/wizards/ebics_xfer.py | 4 -- account_ebics/wizards/ebics_xfer.xml | 32 ++++++++--- 10 files changed, 153 insertions(+), 13 deletions(-) create mode 100644 account_ebics/wizards/ebics_admin_order.py create mode 100644 account_ebics/wizards/ebics_admin_order.xml diff --git a/account_ebics/README.rst b/account_ebics/README.rst index 1e8ac2e..bb9f14d 100644 --- a/account_ebics/README.rst +++ b/account_ebics/README.rst @@ -215,4 +215,5 @@ Known Issues / Roadmap - add support to import externally generated keys & certificates (currently only 3SKey signature certificate). - For Odoo 16.0 the interaction with the OCA payment order and bank statement import modules (e.g. french CFONB) is not yet available. +- Electronic Distributed Signature (EDS) is not supported in the current version of this module. diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 1b0d5d1..4afd992 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,7 @@ { "name": "EBICS banking protocol", - "version": "16.0.1.1.0", + "version": "16.0.1.2.0", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com", @@ -18,6 +18,7 @@ "views/ebics_userid_views.xml", "views/ebics_file_format_views.xml", "wizards/ebics_change_passphrase.xml", + "wizards/ebics_admin_order.xml", "wizards/ebics_xfer.xml", "views/menu.xml", ], diff --git a/account_ebics/security/ir.model.access.csv b/account_ebics/security/ir.model.access.csv index 9c2ae17..97d1f3f 100644 --- a/account_ebics/security/ir.model.access.csv +++ b/account_ebics/security/ir.model.access.csv @@ -10,3 +10,4 @@ access_ebics_file_user,ebics_file user,model_ebics_file,account.group_account_in access_ebics_change_passphrase,access_ebics_change_passphrase,model_ebics_change_passphrase,group_ebics_manager,1,1,1,0 access_ebics_xfer,access_ebics_xfer,model_ebics_xfer,account.group_account_invoice,1,1,1,0 +access_ebics_admin_order,access_ebics_admin_order,model_ebics_admin_order,group_ebics_manager,1,1,1,0 diff --git a/account_ebics/static/description/index.html b/account_ebics/static/description/index.html index 1b996fb..b9815df 100644 --- a/account_ebics/static/description/index.html +++ b/account_ebics/static/description/index.html @@ -564,6 +564,7 @@ You can also find this information in the doc folder of this module (file EBICS_ diff --git a/account_ebics/views/menu.xml b/account_ebics/views/menu.xml index b3e3b23..1ad1b0c 100644 --- a/account_ebics/views/menu.xml +++ b/account_ebics/views/menu.xml @@ -73,4 +73,13 @@ sequence="20" /> + + diff --git a/account_ebics/wizards/__init__.py b/account_ebics/wizards/__init__.py index b66b034..55db4e9 100644 --- a/account_ebics/wizards/__init__.py +++ b/account_ebics/wizards/__init__.py @@ -1,2 +1,3 @@ from . import ebics_change_passphrase from . import ebics_xfer +from . import ebics_admin_order diff --git a/account_ebics/wizards/ebics_admin_order.py b/account_ebics/wizards/ebics_admin_order.py new file mode 100644 index 0000000..3f28d0e --- /dev/null +++ b/account_ebics/wizards/ebics_admin_order.py @@ -0,0 +1,53 @@ +# Copyright 2009-2023 Noviat. +# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). + +import pprint + +from odoo import _, api, fields, models + + +class EbicsAdminOrder(models.TransientModel): + _inherit = "ebics.xfer" + _name = "ebics.admin.order" + _description = "EBICS Administrative Order" + + admin_order_type = fields.Selection( + selection=lambda self: self._selection_admin_order_type(), + string="Order", + ) + + @api.model + def _selection_admin_order_type(self): + return [ + ("HAA", "HAA - Business transaction formats BTF"), + ("HPD", "HPD - Bank parameters"), + ("HKD", "HKD - Subscriber information"), + ("HTD", "HTD - Customer properties and settings"), + ] + + def ebics_admin_order(self): + self.ensure_one() + self.ebics_config_id._check_ebics_files() + client = self._setup_client() + if not client: + self.note += ( + _("EBICS client setup failed for connection '%s'") + % self.ebics_config_id.name + ) + else: + data = getattr(client, self.admin_order_type)(parsed=True) + pp = pprint.PrettyPrinter() + self.note = pp.pformat(data) + module = __name__.split("addons.")[1].split(".")[0] + result_view = self.env.ref("%s.ebics_admin_order_view_form_result" % module) + return { + "name": _("EBICS Administrative Order result"), + "res_id": self.id, + "view_type": "form", + "view_mode": "form", + "res_model": "ebics.admin.order", + "view_id": result_view.id, + "target": "new", + "context": self.env.context, + "type": "ir.actions.act_window", + } diff --git a/account_ebics/wizards/ebics_admin_order.xml b/account_ebics/wizards/ebics_admin_order.xml new file mode 100644 index 0000000..1c39f4d --- /dev/null +++ b/account_ebics/wizards/ebics_admin_order.xml @@ -0,0 +1,61 @@ + + + + + EBICS Administrative Order + ebics.admin.order + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + + + + + EBICS Administrative Order result + ebics.admin.order + 2 + +
+ + +
+
+ +
+
+ + + EBICS Administrative Order + ir.actions.act_window + ebics.admin.order + form + new + + + +
diff --git a/account_ebics/wizards/ebics_xfer.py b/account_ebics/wizards/ebics_xfer.py index 89ebbca..2332164 100644 --- a/account_ebics/wizards/ebics_xfer.py +++ b/account_ebics/wizards/ebics_xfer.py @@ -321,10 +321,6 @@ class EbicsXfer(models.TransientModel): "type": "ir.actions.act_window", } - def button_close(self): - self.ensure_one() - return {"type": "ir.actions.act_window_close"} - def view_ebics_file(self): self.ensure_one() module = __name__.split("addons.")[1].split(".")[0] diff --git a/account_ebics/wizards/ebics_xfer.xml b/account_ebics/wizards/ebics_xfer.xml index aef387a..5439285 100644 --- a/account_ebics/wizards/ebics_xfer.xml +++ b/account_ebics/wizards/ebics_xfer.xml @@ -40,10 +40,15 @@ name="ebics_download" string="Download Files" type="object" - class="oe_highlight" + class="btn-primary" + data-hotkey="q" + /> +