mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-11-06 18:10:39 +00:00
[18.0][IMP] pre-commit updates
This commit is contained in:
1 parent
c29b3fd1a1
commit
94538825e1
35 files changed
+91
-106
No files matched your search
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "EBICS - Bank Statement Import (OCA)",
|
||||
"summary": "Process EBICS statement files with the OCA bank statement import",
|
||||
"version": "18.0.1.0.1",
|
||||
"version": "18.0.1.0.2",
|
||||
"author": "Noviat",
|
||||
"website": "https://www.noviat.com/",
|
||||
"category": "Hidden",
|
||||
@@ -13,7 +13,6 @@
|
||||
"account_ebics",
|
||||
"account_statement_import_file",
|
||||
],
|
||||
"installable": True,
|
||||
"auto_install": True,
|
||||
"images": ["static/description/banner.png"],
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
import logging
|
||||
from datetime import date, datetime
|
||||
|
||||
from odoo import _, models
|
||||
from odoo import models
|
||||
|
||||
from odoo.addons.base.models.res_bank import sanitize_account_number
|
||||
|
||||
@@ -39,8 +39,7 @@ class AccountStatementImport(models.TransientModel):
|
||||
sanitized_number = sanitize_account_number(account_number)
|
||||
check_curr = sanitized_number[-3:]
|
||||
if check_curr.isalpha():
|
||||
all_currencies = self.env["res.currency"].search([])
|
||||
if check_curr in all_currencies.mapped("name"):
|
||||
if self.env["res.currency"].search([("name", "=", check_curr)], limit=1):
|
||||
sanitized_number = sanitized_number[:-3]
|
||||
return sanitized_number
|
||||
|
||||
@@ -49,7 +48,7 @@ class AccountStatementImport(models.TransientModel):
|
||||
if self.env.context.get("active_model") == "ebics.file":
|
||||
message = False
|
||||
if len(stmts_vals) == 0:
|
||||
message = _("This file doesn't contain any statement.")
|
||||
message = self.env._("This file doesn't contain any statement.")
|
||||
if not message:
|
||||
no_st_line = True
|
||||
for vals in stmts_vals:
|
||||
@@ -57,10 +56,10 @@ class AccountStatementImport(models.TransientModel):
|
||||
no_st_line = False
|
||||
break
|
||||
if no_st_line:
|
||||
message = _("This file doesn't contain any transaction.")
|
||||
message = self.env._("This file doesn't contain any transaction.")
|
||||
if message:
|
||||
log_msg = (
|
||||
_("Error detected while processing an EBICS File")
|
||||
self.env._("Error detected while processing an EBICS File")
|
||||
+ ":\n"
|
||||
+ message
|
||||
)
|
||||
@@ -99,7 +98,7 @@ class AccountStatementImport(models.TransientModel):
|
||||
else:
|
||||
st_date = st_vals["date"]
|
||||
messages.append(
|
||||
_(
|
||||
self.env._(
|
||||
"Statement %(st_name)s dated %(date)s "
|
||||
"has already been imported.",
|
||||
st_name=st_vals["name"],
|
||||
@@ -108,7 +107,9 @@ class AccountStatementImport(models.TransientModel):
|
||||
)
|
||||
|
||||
if not transactions:
|
||||
messages.append(_("This file doesn't contain any transaction."))
|
||||
messages.append(
|
||||
self.env._("This file doesn't contain any transaction.")
|
||||
)
|
||||
if messages:
|
||||
result["notifications"].append(
|
||||
{"type": "warning", "message": "\n".join(messages)}
|
||||
|
||||
Reference in new issue
Block a user