[IMP] small improvements

This commit is contained in:
Luc De Meyer
2026-04-17 10:20:35 +02:00
parent 394be403bf
commit ac063c16f3
4 changed files with 109 additions and 98 deletions

View File

@@ -1,136 +1,139 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<record id="ebics_xfer_view_form_download" model="ir.ui.view"> <record id="ebics_xfer_view_form_download" model="ir.ui.view">
<field name="name">EBICS File Download</field> <field name="name">EBICS File Download</field>
<field name="model">ebics.xfer</field> <field name="model">ebics.xfer</field>
<field name="priority">1</field> <field name="priority">1</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="EBICS File Download"> <form string="EBICS File Download">
<group> <group>
<separator string="Select your bank :" colspan="2" /> <separator string="Select your bank :" colspan="2" />
<field <field
name="ebics_config_id" name="ebics_config_id"
required="1" required="1"
options="{'no_create': True, 'no_open': True}" options="{'no_create': True, 'no_open': True}"
/> />
<field <field
name="ebics_userid_id" name="ebics_userid_id"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'down'])]" domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'down'])]"
required="1" required="1"
options="{'no_create': True, 'no_open': True}" options="{'no_create': True, 'no_open': True}"
/> />
<field <field
name="ebics_passphrase" name="ebics_passphrase"
password="True" password="True"
invisible="ebics_passphrase_store" invisible="ebics_passphrase_store"
required="not ebics_passphrase_store" required="not ebics_passphrase_store"
/> />
<field name="ebics_passphrase_store" invisible="1" /> <field name="ebics_passphrase_store" invisible="1" />
<field name="date_from" /> <field name="date_from" />
<field name="date_to" /> <field name="date_to" />
<field <field
name="format_id" name="format_id"
domain="[('type', '=', 'down'), ('id', 'in', allowed_format_ids)]" domain="[('type', '=', 'down'), ('id', 'in', allowed_format_ids)]"
/> />
<field name="order_type" /> <field name="order_type" />
<field name="allowed_format_ids" invisible="1" /> <field name="allowed_format_ids" invisible="1" />
</group> </group>
<footer> <footer>
<button <button
name="ebics_download" name="ebics_download"
string="Download Files" string="Download Files"
type="object" type="object"
class="btn-primary" class="btn-primary"
data-hotkey="q" data-hotkey="q"
/> />
<button <button
string="Cancel" string="Cancel"
class="btn-secondary" class="btn-secondary"
special="cancel" special="cancel"
data-hotkey="z" data-hotkey="z"
/> />
</footer> </footer>
</form> </form>
</field> </field>
</record> </record>
<record id="ebics_xfer_view_form_upload" model="ir.ui.view"> <record id="ebics_xfer_view_form_upload" model="ir.ui.view">
<field name="name">EBICS File Upload</field> <field name="name">EBICS File Upload</field>
<field name="model">ebics.xfer</field> <field name="model">ebics.xfer</field>
<field name="priority">1</field> <field name="priority">1</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="EBICS File Upload"> <form string="EBICS File Upload">
<group> <group>
<separator string="Select your bank :" colspan="2" /> <separator string="Select your bank :" colspan="2" />
<field <field
name="ebics_config_id" name="ebics_config_id"
required="1" required="1"
options="{'no_create': True, 'no_open': True}" options="{'no_create': True, 'no_open': True}"
/> />
<field <field
name="ebics_userid_id" name="ebics_userid_id"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'up'])]" domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'up'])]"
required="1" required="1"
options="{'no_create': True, 'no_open': True}" options="{'no_create': True, 'no_open': True}"
/> />
<field <field
name="ebics_passphrase" name="ebics_passphrase"
password="True" password="True"
invisible="ebics_passphrase_store" invisible="ebics_passphrase_store"
required="not ebics_passphrase_store" required="not ebics_passphrase_store"
/> />
<field <field
name="ebics_sig_passphrase" name="ebics_sig_passphrase"
password="True" password="True"
invisible="ebics_sig_passphrase_invisible" invisible="ebics_sig_passphrase_invisible"
/> />
<field name="ebics_passphrase_store" invisible="1" /> <field name="ebics_passphrase_store" invisible="1" />
<field name="ebics_sig_passphrase_invisible" invisible="1" /> <field name="ebics_sig_passphrase_invisible" invisible="1" />
<separator string="Select your file :" colspan="2" /> <separator string="Select your file :" colspan="2" />
<field name="upload_data" filename="upload_fname" required="1" /> <field name="upload_data" filename="upload_fname" required="1" />
<field name="upload_fname" invisible="1" /> <field name="upload_fname" invisible="1" />
<field name="upload_fname_dummy" string="Upload Filename" /> <field name="upload_fname_dummy" string="Upload Filename" />
<field name="upload_format_ids" invisible="1" /> <field name="upload_format_ids" invisible="1" />
<field <field
name="format_id" name="format_id"
required="1" required="1"
domain="[('type', '=', 'up'), ('id', 'in', allowed_format_ids)]" domain="[('type', '=', 'up'), ('id', 'in', allowed_format_ids)]"
readonly="context.get('active_model') == 'account.payment.order'" readonly="context.get('active_model') == 'account.payment.order'"
/> />
<field name="order_type" /> <field name="order_type" />
<field name="test_mode" invisible="order_type not in ('FUL', 'BTU')" /> <field
<field name="allowed_format_ids" invisible="1" /> name="test_mode"
</group> invisible="order_type not in ('FUL', 'BTU')"
<footer> />
<button <field name="allowed_format_ids" invisible="1" />
</group>
<footer>
<button
name="ebics_upload" name="ebics_upload"
string="Upload File" string="Upload File"
type="object" type="object"
class="btn-primary" class="btn-primary"
data-hotkey="q" data-hotkey="q"
/> />
<button <button
string="Cancel" string="Cancel"
class="btn-secondary" class="btn-secondary"
special="cancel" special="cancel"
data-hotkey="z" data-hotkey="z"
/> />
</footer> </footer>
</form> </form>
</field> </field>
</record> </record>
<record id="ebics_xfer_view_form_result" model="ir.ui.view"> <record id="ebics_xfer_view_form_result" model="ir.ui.view">
<field name="name">EBICS File Transfer</field> <field name="name">EBICS File Transfer</field>
<field name="model">ebics.xfer</field> <field name="model">ebics.xfer</field>
<field name="priority">2</field> <field name="priority">2</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="EBICS File Transfer"> <form string="EBICS File Transfer">
<separator colspan="4" string="Results :" /> <separator colspan="4" string="Results :" />
<field name="note" colspan="4" nolabel="1" width="850" height="400" /> <field name="note" colspan="4" nolabel="1" width="850" height="400" />
<footer> <footer>
<button <button
name="view_ebics_file" name="view_ebics_file"
type="object" type="object"
string="View EBICS File(s)" string="View EBICS File(s)"
@@ -138,36 +141,36 @@
invisible="not context.get('ebics_file_ids')" invisible="not context.get('ebics_file_ids')"
data-hotkey="q" data-hotkey="q"
/> />
<button <button
string="Close" string="Close"
class="btn-secondary" class="btn-secondary"
special="cancel" special="cancel"
data-hotkey="z" data-hotkey="z"
/> />
</footer> </footer>
</form> </form>
</field> </field>
</record> </record>
<record id="ebics_xfer_action_download" model="ir.actions.act_window"> <record id="ebics_xfer_action_download" model="ir.actions.act_window">
<field name="name">EBICS File Transfer - Download</field> <field name="name">EBICS File Transfer - Download</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.xfer</field> <field name="res_model">ebics.xfer</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">new</field> <field name="target">new</field>
<field name="context">{'ebics_download': 1}</field> <field name="context">{'ebics_download': 1}</field>
<field name="view_id" ref="ebics_xfer_view_form_download" /> <field name="view_id" ref="ebics_xfer_view_form_download" />
</record> </record>
<record id="ebics_xfer_action_upload" model="ir.actions.act_window"> <record id="ebics_xfer_action_upload" model="ir.actions.act_window">
<field name="name">EBICS File Transfer - Upload</field> <field name="name">EBICS File Transfer - Upload</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.xfer</field> <field name="res_model">ebics.xfer</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">new</field> <field name="target">new</field>
<field name="context">{'ebics_upload': 1}</field> <field name="context">{'ebics_upload': 1}</field>
<field name="view_id" ref="ebics_xfer_view_form_upload" /> <field name="view_id" ref="ebics_xfer_view_form_upload" />
</record> </record>
<record id="ebics_xfer_view_form_mark_as_downloaded" model="ir.ui.view"> <record id="ebics_xfer_view_form_mark_as_downloaded" model="ir.ui.view">
<field name="name">Mark EBICS files as Downloaded</field> <field name="name">Mark EBICS files as Downloaded</field>
@@ -176,9 +179,11 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="EBICS Mark as Downloaded"> <form string="EBICS Mark as Downloaded">
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
The EBICS Files (Bank Statements) selected via this screen will not become available in Odoo as EBICS files but will be marked by your bank as downloaded. The EBICS Files (Bank Statements) selected via this screen will not become available in Odoo as
EBICS files but will be marked by your bank as downloaded.
<br /> <br />
As a consequence, these Bank Statements will not be retrieved by the next 'EBICS Batch Import' scheduled action. As a consequence, these Bank Statements will not be retrieved by the next 'EBICS Batch Import'
scheduled action.
</div> </div>
<group> <group>
<separator string="Select your bank :" colspan="2" /> <separator string="Select your bank :" colspan="2" />
@@ -199,6 +204,7 @@
invisible="ebics_passphrase_store" invisible="ebics_passphrase_store"
required="not ebics_passphrase_store" required="not ebics_passphrase_store"
/> />
<field name="ebics_passphrase_store" invisible="1" />
<field name="date_from" required="1" /> <field name="date_from" required="1" />
<field name="date_to" required="1" /> <field name="date_to" required="1" />
<field <field
@@ -206,6 +212,7 @@
required="1" required="1"
domain="[('type', '=', 'down'), ('id', 'in', allowed_format_ids)]" domain="[('type', '=', 'down'), ('id', 'in', allowed_format_ids)]"
/> />
<field name="allowed_format_ids" invisible="1" />
</group> </group>
<footer> <footer>
<button <button

View File

@@ -1,15 +1,18 @@
# Copyright 2020 Noviat. # Copyright 2020 Noviat.
# License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl).
from odoo import _, fields, models from odoo import _, api, fields, models
from odoo.exceptions import UserError from odoo.exceptions import UserError
class AccountBatchPayment(models.Model): class AccountBatchPayment(models.Model):
_inherit = "account.batch.payment" _inherit = "account.batch.payment"
hide_ebics_upload = fields.Boolean(compute="_compute_hide_ebics_upload") hide_ebics_upload = fields.Boolean(
compute="_compute_hide_ebics_upload", default=True
)
@api.depends("journal_id.ebics_config_id", "file_generation_enabled", "state")
def _compute_hide_ebics_upload(self): def _compute_hide_ebics_upload(self):
for rec in self: for rec in self:
rec.hide_ebics_upload = ( rec.hide_ebics_upload = (
@@ -47,7 +50,6 @@ class AccountBatchPayment(models.Model):
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload") view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
act = { act = {
"name": _("EBICS Upload"), "name": _("EBICS Upload"),
"view_type": "form",
"view_mode": "form", "view_mode": "form",
"res_model": "ebics.xfer", "res_model": "ebics.xfer",
"view_id": view.id, "view_id": view.id,

View File

@@ -1,5 +1,5 @@
# Copyright 2015 Noviat. # Copyright 2015 Noviat.
# License LGPL-3 or later (https://www.gnu.org/licenses/lpgl). # License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).
from odoo import fields, models from odoo import fields, models

View File

@@ -1,15 +1,18 @@
# Copyright 2015 Noviat. # Copyright 2015 Noviat.
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl). # License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).
from odoo import _, fields, models from odoo import _, api, fields, models
from odoo.exceptions import UserError from odoo.exceptions import UserError
class AccountPaymentOrder(models.Model): class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order" _inherit = "account.payment.order"
hide_ebics_upload = fields.Boolean(compute="_compute_hide_ebics_upload") 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): def _compute_hide_ebics_upload(self):
for rec in self: for rec in self:
rec.hide_ebics_upload = ( rec.hide_ebics_upload = (
@@ -77,7 +80,6 @@ class AccountPaymentOrder(models.Model):
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload") view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
act = { act = {
"name": _("EBICS Upload"), "name": _("EBICS Upload"),
"view_type": "form",
"view_mode": "form", "view_mode": "form",
"res_model": "ebics.xfer", "res_model": "ebics.xfer",
"view_id": view.id, "view_id": view.id,