From ebe6a6b43d94d6f724a5afbf9e308bc3ad997467 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Fri, 3 Jan 2025 15:01:54 +0100 Subject: [PATCH] [IMP] account_ebics: hide process button on ebics_file when no download process --- account_ebics/__manifest__.py | 4 +- .../migrations/17.0.1.2/post-migration.py | 15 +++ account_ebics/models/ebics_file.py | 7 +- account_ebics/views/ebics_config_views.xml | 2 +- .../views/ebics_file_format_views.xml | 104 +++++++++--------- account_ebics/views/ebics_file_views.xml | 47 +++++--- account_ebics/views/ebics_userid_views.xml | 2 +- account_ebics/views/menu.xml | 2 +- account_ebics/wizards/ebics_xfer.py | 3 +- account_ebics_batch/__manifest__.py | 4 +- account_ebics_batch/models/ebics_batch_log.py | 4 +- 11 files changed, 113 insertions(+), 81 deletions(-) create mode 100644 account_ebics/migrations/17.0.1.2/post-migration.py diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 5b9b51a..df81bb9 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -1,9 +1,9 @@ -# Copyright 2009-2024 Noviat. +# Copyright 2009-2025 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). { "name": "EBICS banking protocol", - "version": "17.0.1.1.2", + "version": "17.0.1.2.0", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com", diff --git a/account_ebics/migrations/17.0.1.2/post-migration.py b/account_ebics/migrations/17.0.1.2/post-migration.py new file mode 100644 index 0000000..2c5b89e --- /dev/null +++ b/account_ebics/migrations/17.0.1.2/post-migration.py @@ -0,0 +1,15 @@ +# Copyright 2009-2025 Noviat. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +def migrate(cr, version): + cr.execute( # pylint: disable=E8103 + """ + UPDATE ebics_file ef + SET state = 'done' + FROM ebics_file_format eff + WHERE ef.format_id = eff.id + AND eff.type = 'down' + AND eff.download_process_method IS NULL; + """ + ) diff --git a/account_ebics/models/ebics_file.py b/account_ebics/models/ebics_file.py index 66f2af8..6eb0157 100644 --- a/account_ebics/models/ebics_file.py +++ b/account_ebics/models/ebics_file.py @@ -1,4 +1,4 @@ -# Copyright 2009-2024 Noviat. +# Copyright 2009-2025 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). import base64 @@ -36,7 +36,10 @@ class EbicsFile(models.Model): format_id = fields.Many2one( comodel_name="ebics.file.format", string="EBICS File Formats", readonly=True ) - type = fields.Selection(related="format_id.type", readonly=True) + download_process_method = fields.Selection( + related="format_id.download_process_method" + ) + type = fields.Selection(related="format_id.type") date_from = fields.Date( readonly=True, help="'Date From' as entered in the download wizard." ) diff --git a/account_ebics/views/ebics_config_views.xml b/account_ebics/views/ebics_config_views.xml index 054586b..750d4db 100644 --- a/account_ebics/views/ebics_config_views.xml +++ b/account_ebics/views/ebics_config_views.xml @@ -1,4 +1,4 @@ - + diff --git a/account_ebics/views/ebics_file_format_views.xml b/account_ebics/views/ebics_file_format_views.xml index 25b81e7..8047b5c 100644 --- a/account_ebics/views/ebics_file_format_views.xml +++ b/account_ebics/views/ebics_file_format_views.xml @@ -1,74 +1,74 @@ - + - - ebics.file.format.tree - ebics.file.format - - - - - - - - - - - + + ebics.file.format.tree + ebics.file.format + + + + + + + + + + + - - ebics.file.format.form - ebics.file.format - -
- - - - - - + ebics.file.format.form + ebics.file.format + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + +
- - EBICS File Formats - ebics.file.format - tree,form - + + EBICS File Formats + ebics.file.format + tree,form +
diff --git a/account_ebics/views/ebics_file_views.xml b/account_ebics/views/ebics_file_views.xml index 9d4771a..6ffbfd3 100644 --- a/account_ebics/views/ebics_file_views.xml +++ b/account_ebics/views/ebics_file_views.xml @@ -1,4 +1,4 @@ - + @@ -77,9 +77,10 @@
+
- - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/account_ebics/views/ebics_userid_views.xml b/account_ebics/views/ebics_userid_views.xml index 61447be..92f4569 100644 --- a/account_ebics/views/ebics_userid_views.xml +++ b/account_ebics/views/ebics_userid_views.xml @@ -1,4 +1,4 @@ - + diff --git a/account_ebics/views/menu.xml b/account_ebics/views/menu.xml index 1ad1b0c..0ac9cee 100644 --- a/account_ebics/views/menu.xml +++ b/account_ebics/views/menu.xml @@ -1,4 +1,4 @@ - +