mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-04-25 23:26:50 +00:00
[MIG] account_ebics_batch: Migration to 19.0
This commit is contained in:
@@ -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"],
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">model._batch_import()</field>
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_number" eval="1" />
|
||||
<field name="interval_type">days</field>
|
||||
<field name="active" eval="False" />
|
||||
</record>
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="ebics_batch_log_view_search" model="ir.ui.view">
|
||||
<field name="name">ebics.batch.log.search</field>
|
||||
@@ -10,7 +10,7 @@
|
||||
<field name="state" />
|
||||
</group>
|
||||
<newline />
|
||||
<group expand="0" string="Group By">
|
||||
<group>
|
||||
<filter
|
||||
name="group_by_state"
|
||||
string="State"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<menuitem
|
||||
id="ebics_batch_log_menu"
|
||||
|
||||
Reference in New Issue
Block a user