mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-11-06 18:10:39 +00:00
[IMP] addons-repo-template v9.2.1
This commit is contained in:
1 parent
e4c40c373e
commit
296695f97a
21 files changed
+188
-291
No files matched your search
@@ -225,9 +225,8 @@ class EbicsFile(models.Model):
|
||||
journal_currency = jrnl.currency_id or jrnl.company_id.currency_id
|
||||
if journal_currency != currency:
|
||||
continue
|
||||
else:
|
||||
journal = jrnl
|
||||
break
|
||||
journal = jrnl
|
||||
break
|
||||
|
||||
if not journal:
|
||||
message = self.env._(
|
||||
@@ -301,7 +300,7 @@ class EbicsFile(models.Model):
|
||||
self.note_process += self.env._(
|
||||
"%(st_cnt)s bank statement%(sp)s been imported: ",
|
||||
st_cnt=st_cnt,
|
||||
sp=st_cnt == 1 and self.env._(" has") or self.env._("s have"),
|
||||
sp=(st_cnt == 1 and self.env._(" has")) or self.env._("s have"),
|
||||
)
|
||||
self.note_process += "\n"
|
||||
for statement in statements:
|
||||
@@ -392,9 +391,7 @@ class EbicsFile(models.Model):
|
||||
res["notifications"].append({"type": "error", "message": message})
|
||||
return datas
|
||||
|
||||
lines = []
|
||||
for i in range(0, len(file_data), 120):
|
||||
lines.append(file_data[i : i + 120])
|
||||
lines = [file_data[i : i + 120] for i in range(0, len(file_data), 120)]
|
||||
|
||||
st_lines = b""
|
||||
transactions = False
|
||||
@@ -488,11 +485,12 @@ class EbicsFile(models.Model):
|
||||
try:
|
||||
with self.env.cr.savepoint():
|
||||
self._create_bank_statement_oca(res, st_data)
|
||||
except UserError as e:
|
||||
except UserError as e: # noqa: PERF203
|
||||
res["notifications"].append(
|
||||
{"type": "error", "message": "".join(e.args)}
|
||||
)
|
||||
except Exception:
|
||||
# Each statement fails alone; the traceback is reported to the user
|
||||
except Exception: # noqa: BLE001
|
||||
tb = "".join(format_exception(*exc_info()))
|
||||
res["notifications"].append({"type": "error", "message": tb})
|
||||
|
||||
@@ -514,7 +512,7 @@ class EbicsFile(models.Model):
|
||||
try:
|
||||
self._create_bank_statement_oe(res, st_data)
|
||||
self.env.cr.commit() # pylint: disable=E8102
|
||||
except UserError as e:
|
||||
except UserError as e: # noqa: PERF203
|
||||
msg = "".join(e.args)
|
||||
msg += "\n"
|
||||
msg += self.env._(
|
||||
@@ -522,7 +520,8 @@ class EbicsFile(models.Model):
|
||||
nr=st_data["acc_number"],
|
||||
)
|
||||
res["notifications"].append({"type": "error", "message": msg})
|
||||
except Exception:
|
||||
# Each statement fails alone; the traceback is reported to the user
|
||||
except Exception: # noqa: BLE001
|
||||
tb = "".join(format_exception(*exc_info()))
|
||||
res["notifications"].append({"type": "error", "message": tb})
|
||||
|
||||
|
||||
Reference in new issue
Block a user