[16.0]add support for some administrative order types

This commit is contained in:
Luc De Meyer 2023-05-28 22:12:47 +02:00
parent 1a1d951d61
commit 7138d9723b
10 changed files with 153 additions and 13 deletions

View File

@ -215,4 +215,5 @@ Known Issues / Roadmap
- add support to import externally generated keys & certificates (currently only 3SKey signature certificate). - 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. - 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.

View File

@ -3,7 +3,7 @@
{ {
"name": "EBICS banking protocol", "name": "EBICS banking protocol",
"version": "16.0.1.1.0", "version": "16.0.1.2.0",
"license": "LGPL-3", "license": "LGPL-3",
"author": "Noviat", "author": "Noviat",
"website": "https://www.noviat.com", "website": "https://www.noviat.com",
@ -18,6 +18,7 @@
"views/ebics_userid_views.xml", "views/ebics_userid_views.xml",
"views/ebics_file_format_views.xml", "views/ebics_file_format_views.xml",
"wizards/ebics_change_passphrase.xml", "wizards/ebics_change_passphrase.xml",
"wizards/ebics_admin_order.xml",
"wizards/ebics_xfer.xml", "wizards/ebics_xfer.xml",
"views/menu.xml", "views/menu.xml",
], ],

View File

@ -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_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_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

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
10 access_ebics_change_passphrase access_ebics_change_passphrase model_ebics_change_passphrase group_ebics_manager 1 1 1 0
11 access_ebics_xfer access_ebics_xfer model_ebics_xfer account.group_account_invoice 1 1 1 0
12 access_ebics_admin_order access_ebics_admin_order model_ebics_admin_order group_ebics_manager 1 1 1 0
13

View File

@ -564,6 +564,7 @@ You can also find this information in the doc folder of this module (file EBICS_
<ul class="simple"> <ul class="simple">
<li>add support to import externally generated keys &amp; certificates (currently only 3SKey signature certificate).</li> <li>add support to import externally generated keys &amp; certificates (currently only 3SKey signature certificate).</li>
<li>For Odoo 16.0 the interaction with the OCA payment order and bank statement import modules (e.g. french CFONB) is not yet available.</li> <li>For Odoo 16.0 the interaction with the OCA payment order and bank statement import modules (e.g. french CFONB) is not yet available.</li>
<li>Electronic Distributed Signature (EDS) is not supported in the current version of this module.</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -73,4 +73,13 @@
sequence="20" sequence="20"
/> />
<menuitem
id="ebics_admin_order_menu"
name="EBICS Administrative Orders"
parent="ebics_menu"
action="ebics_admin_order_action"
groups="account_ebics.group_ebics_manager"
sequence="30"
/>
</odoo> </odoo>

View File

@ -1,2 +1,3 @@
from . import ebics_change_passphrase from . import ebics_change_passphrase
from . import ebics_xfer from . import ebics_xfer
from . import ebics_admin_order

View File

@ -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",
}

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="ebics_admin_order_view_form" model="ir.ui.view">
<field name="name">EBICS Administrative Order</field>
<field name="model">ebics.admin.order</field>
<field name="inherit_id" ref="ebics_xfer_view_form_download" />
<field name="priority">1</field>
<field name="arch" type="xml">
<field name="date_from" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="date_to" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="format_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="order_type" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="order_type" position="after">
<field name="admin_order_type" />
</field>
<button name="ebics_download" position="attributes">
<attribute name="name">ebics_admin_order</attribute>
<attribute name="string">Execute</attribute>
</button>
</field>
</record>
<record id="ebics_admin_order_view_form_result" model="ir.ui.view">
<field name="name">EBICS Administrative Order result</field>
<field name="model">ebics.admin.order</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<form string="EBICS Administrative Order result">
<separator colspan="4" string="Results :" />
<field name="note" colspan="4" nolabel="1" width="850" height="400" />
<footer>
<button
string="Close"
class="btn-secondary"
special="cancel"
data-hotkey="z"
/>
</footer>
</form>
</field>
</record>
<record id="ebics_admin_order_action" model="ir.actions.act_window">
<field name="name">EBICS Administrative Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.admin.order</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="ebics_admin_order_view_form" />
</record>
</odoo>

View File

@ -321,10 +321,6 @@ class EbicsXfer(models.TransientModel):
"type": "ir.actions.act_window", "type": "ir.actions.act_window",
} }
def button_close(self):
self.ensure_one()
return {"type": "ir.actions.act_window_close"}
def view_ebics_file(self): def view_ebics_file(self):
self.ensure_one() self.ensure_one()
module = __name__.split("addons.")[1].split(".")[0] module = __name__.split("addons.")[1].split(".")[0]

View File

@ -40,10 +40,15 @@
name="ebics_download" name="ebics_download"
string="Download Files" string="Download Files"
type="object" type="object"
class="oe_highlight" class="btn-primary"
data-hotkey="q"
/>
<button
string="Cancel"
class="btn-secondary"
special="cancel"
data-hotkey="z"
/> />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>
</form> </form>
</field> </field>
@ -95,10 +100,15 @@
name="ebics_upload" name="ebics_upload"
string="Upload File" string="Upload File"
type="object" type="object"
class="oe_highlight" class="btn-primary"
data-hotkey="q"
/>
<button
string="Cancel"
class="btn-secondary"
special="cancel"
data-hotkey="z"
/> />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>
</form> </form>
</field> </field>
@ -117,10 +127,16 @@
name="view_ebics_file" name="view_ebics_file"
type="object" type="object"
string="View EBICS File(s)" string="View EBICS File(s)"
class="oe_highlight" class="btn-primary"
invisible="not context.get('ebics_file_ids')" invisible="not context.get('ebics_file_ids')"
data-hotkey="q"
/>
<button
string="Close"
class="btn-secondary"
special="cancel"
data-hotkey="z"
/> />
<button name="button_close" type="object" string="Close" />
</footer> </footer>
</form> </form>
</field> </field>