mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-12-24 18:31:45 +00:00
Merge pull request #68 from Noviat/16-fix-ebics_download
16 fix ebics download
This commit is contained in:
commit
a9432774cf
@ -71,7 +71,7 @@ class EbicsFile(models.Model):
|
||||
)
|
||||
note = fields.Text(string="Notes")
|
||||
note_process = fields.Text(
|
||||
string="Notes",
|
||||
string="Process Notes",
|
||||
readonly=True,
|
||||
)
|
||||
company_ids = fields.Many2many(
|
||||
@ -90,7 +90,7 @@ class EbicsFile(models.Model):
|
||||
ff = ebics_file.format_id.download_process_method
|
||||
if ff in ff_methods:
|
||||
if ff_methods[ff].get("unlink"):
|
||||
ff_methods[ff]["unlink"](ebics_file)
|
||||
ff_methods[ff]["unlink"]()
|
||||
# remove bank statements
|
||||
ebics_file.bank_statement_ids.unlink()
|
||||
return super().unlink()
|
||||
@ -445,8 +445,10 @@ class EbicsFile(models.Model):
|
||||
)
|
||||
if not currency:
|
||||
message = msg_hdr.format(_("Error"))
|
||||
message += _("Currency %(cc) not found.", cc=currency_code)
|
||||
res["notifications"] = {"type": "error", "message": message}
|
||||
message += _("Currency %(cc)s not found.", cc=currency_code)
|
||||
res["notifications"].append(
|
||||
{"type": "error", "message": message}
|
||||
)
|
||||
continue
|
||||
journal = self.env["account.journal"].search(
|
||||
[
|
||||
@ -465,7 +467,7 @@ class EbicsFile(models.Model):
|
||||
message = msg_hdr.format(_("Error"))
|
||||
message += _(
|
||||
"No financial journal found for Account Number %(nbr)s, "
|
||||
"Currency %(cc)",
|
||||
"Currency %(cc)s",
|
||||
nbr=acc_number,
|
||||
cc=currency_code,
|
||||
)
|
||||
|
@ -107,7 +107,7 @@ class EbicsUserID(models.Model):
|
||||
"by means of the SWIFT 3SKey token.",
|
||||
)
|
||||
swift_3skey_certificate = fields.Binary(string="3SKey Certficate")
|
||||
swift_3skey_certificate_fn = fields.Char(string="EBICS Public Bank Keys Filename")
|
||||
swift_3skey_certificate_fn = fields.Char(string="EBICS certificate name")
|
||||
# X.509 Distinguished Name attributes used to
|
||||
# create self-signed X.509 certificates
|
||||
ebics_key_x509 = fields.Boolean(
|
||||
|
@ -65,7 +65,7 @@ class EbicsXfer(models.TransientModel):
|
||||
date_from = fields.Date()
|
||||
date_to = fields.Date()
|
||||
upload_data = fields.Binary(string="File to Upload")
|
||||
upload_fname = fields.Char(string="Upload Filename", default="")
|
||||
upload_fname = fields.Char(default="")
|
||||
upload_fname_dummy = fields.Char(
|
||||
related="upload_fname", string="Upload Filename", readonly=True
|
||||
)
|
||||
@ -233,7 +233,7 @@ class EbicsXfer(models.TransientModel):
|
||||
self.note += _(
|
||||
"EBICS Functional Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
name=df.name or df.description,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
@ -245,7 +245,7 @@ class EbicsXfer(models.TransientModel):
|
||||
self.note += _(
|
||||
"EBICS Technical Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
name=df.name or df.description,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
@ -256,28 +256,29 @@ class EbicsXfer(models.TransientModel):
|
||||
self.note += _(
|
||||
"EBICS Verification Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
name=df.name or df.description,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += _("The EBICS response could not be verified.")
|
||||
except UserError as e:
|
||||
err_cnt += 1
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"Warning during download of "
|
||||
"Error detected during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
name=df.name or df.description,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += e.name
|
||||
self.note += " ".join(e.args)
|
||||
except Exception:
|
||||
err_cnt += 1
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"Unknown Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
name=df.name or df.description,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
tb = "".join(format_exception(*exc_info()))
|
||||
|
Loading…
Reference in New Issue
Block a user