[MIG] account_ebics_batch: Migration to 18.0

This commit is contained in:
Luc De Meyer 2024-12-25 16:50:18 +01:00
parent c7d20b3bcd
commit 416114793d
4 changed files with 27 additions and 27 deletions

View File

@ -3,7 +3,7 @@
{
"name": "EBICS Files batch import",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Noviat",
"website": "https://www.noviat.com",

View File

@ -9,9 +9,7 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="active" eval="False" />
<field name="doall" eval="False" />
</record>
</odoo>

View File

@ -4,7 +4,7 @@
from sys import exc_info
from traceback import format_exception
from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import UserError
@ -49,7 +49,9 @@ class EbicsBatchLog(models.Model):
def unlink(self):
for log in self:
if log.state != "draft":
raise UserError(_("Only log objects in state 'draft' can be deleted !"))
raise UserError(
self.env._("Only log objects in state 'draft' can be deleted !")
)
return super().unlink()
def button_draft(self):
@ -94,12 +96,13 @@ class EbicsBatchLog(models.Model):
ebics_file_ids = []
for config in configs:
err_msg = (
_("Error while processing EBICS connection '%s' :\n") % config.name
self.env._("Error while processing EBICS connection '%s' :\n")
% config.name
)
if config.state == "draft":
import_dict["errors"].append(
err_msg
+ _(
+ self.env._(
"Please set state to 'Confirm' and "
"Reprocess this EBICS Import Log."
)
@ -108,7 +111,7 @@ class EbicsBatchLog(models.Model):
if not any(config.mapped("ebics_userid_ids.ebics_passphrase_store")):
import_dict["errors"].append(
err_msg
+ _(
+ self.env._(
"No EBICS UserID with stored passphrase found.\n"
"You should configure such a UserID for automated downloads."
)

View File

@ -18,15 +18,15 @@
</field>
</record>
<record id="ebics_batch_log_view_tree" model="ir.ui.view">
<field name="name">ebics.batch.log.tree</field>
<record id="ebics_batch_log_view_list" model="ir.ui.view">
<field name="name">ebics.batch.log.list</field>
<field name="model">ebics.batch.log</field>
<field name="arch" type="xml">
<tree create="false">
<list create="false">
<field name="create_date" />
<field name="file_count" />
<field name="state" />
</tree>
</list>
</field>
</record>
@ -78,16 +78,15 @@
<group colspan="4" col="4">
<field name="create_date" />
<field name="ebics_config_ids" widget="many2many_tags" />
<field name="has_draft_files" invisible="1" />
</group>
<notebook colspan="4">
<page string="Batch Import Logs">
<field name="log_ids" nolabel="1">
<tree>
<list>
<field name="create_date" />
<field name="state" />
<field name="error_count" />
</tree>
</list>
<form string="Batch Import Log">
<group colspan="4" col="6">
<field name="create_date" />
@ -110,8 +109,8 @@
<field name="name">EBICS Batch Import Logs</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.batch.log</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="ebics_batch_log_view_tree" />
<field name="view_mode">list,form</field>
<field name="view_id" ref="ebics_batch_log_view_list" />
<field name="search_view_id" ref="ebics_batch_log_view_search" />
</record>