diff --git a/account_ebics_batch/__manifest__.py b/account_ebics_batch/__manifest__.py index 550f79e..d4cd484 100644 --- a/account_ebics_batch/__manifest__.py +++ b/account_ebics_batch/__manifest__.py @@ -1,9 +1,9 @@ -# Copyright 2009-2025 Noviat. -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# Copyright 2022 Noviat. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "EBICS Files batch import", - "version": "18.0.1.0.0", + "version": "19.0.1.0.0", "license": "AGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", @@ -16,6 +16,5 @@ "views/ebics_batch_log_views.xml", "views/menu.xml", ], - "installable": True, "images": ["static/description/cover.png"], } diff --git a/account_ebics_batch/data/ir_cron_data.xml b/account_ebics_batch/data/ir_cron_data.xml index 209f544..07bfaaa 100644 --- a/account_ebics_batch/data/ir_cron_data.xml +++ b/account_ebics_batch/data/ir_cron_data.xml @@ -6,7 +6,7 @@ code model._batch_import() - 1 + days diff --git a/account_ebics_batch/models/ebics_batch_log.py b/account_ebics_batch/models/ebics_batch_log.py index 93a2ed9..b90783a 100644 --- a/account_ebics_batch/models/ebics_batch_log.py +++ b/account_ebics_batch/models/ebics_batch_log.py @@ -1,5 +1,5 @@ -# Copyright 2009-2024 Noviat. -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# Copyright 2022 Noviat. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from sys import exc_info from traceback import format_exception @@ -46,13 +46,12 @@ class EbicsBatchLog(models.Model): rec.has_draft_files = "draft" in rec.file_ids.mapped("state") rec.file_count = len(rec.file_ids) - def unlink(self): - for log in self: - if log.state != "draft": - raise UserError( - self.env._("Only log objects in state 'draft' can be deleted !") - ) - return super().unlink() + @api.ondelete(at_uninstall=False) + def _unlink_unless_draft(self): + if any(rec.state != "draft" for rec in self): + raise UserError( + self.env._("Only log objects in state 'draft' can be deleted !") + ) def button_draft(self): self.state = "draft" @@ -95,9 +94,8 @@ class EbicsBatchLog(models.Model): ) ebics_file_ids = [] for config in configs: - err_msg = ( - self.env._("Error while processing EBICS connection '%s' :\n") - % config.name + err_msg = self.env._( + "Error while processing EBICS connection '%s' :\n", config.name ) if config.state == "draft": import_dict["errors"].append( diff --git a/account_ebics_batch/views/ebics_batch_log_views.xml b/account_ebics_batch/views/ebics_batch_log_views.xml index 5e7a376..198f722 100644 --- a/account_ebics_batch/views/ebics_batch_log_views.xml +++ b/account_ebics_batch/views/ebics_batch_log_views.xml @@ -1,4 +1,4 @@ - + ebics.batch.log.search @@ -10,7 +10,7 @@ - + +