mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-27 14:37:25 +00:00
[IMP] add support for non-stored passphrase
This commit is contained in:
parent
9ed8f14c87
commit
bf02b47e69
@ -105,6 +105,15 @@ class EbicsBatchLog(models.Model):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
if not any(config.mapped("ebics_userid_ids.ebics_passphrase_store")):
|
||||||
|
import_dict["errors"].append(
|
||||||
|
err_msg
|
||||||
|
+ _(
|
||||||
|
"No EBICS UserID with stored passphrase found.\n"
|
||||||
|
"You should configure such a UserID for automated downloads."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
with self.env.cr.savepoint():
|
with self.env.cr.savepoint():
|
||||||
ebics_file_ids += self._ebics_import(
|
ebics_file_ids += self._ebics_import(
|
||||||
@ -146,6 +155,11 @@ class EbicsBatchLog(models.Model):
|
|||||||
self.state = state
|
self.state = state
|
||||||
|
|
||||||
def _ebics_import(self, config, date_from, date_to, import_dict):
|
def _ebics_import(self, config, date_from, date_to, import_dict):
|
||||||
|
ebics_userids = config.ebics_userid_ids.filtered(
|
||||||
|
lambda r: r.ebics_passphrase_store
|
||||||
|
)
|
||||||
|
t_userids = ebics_userids.filtered(lambda r: r.signature_class == "T")
|
||||||
|
ebics_userid = t_userids and t_userids[0] or ebics_userids[0]
|
||||||
xfer_wiz = (
|
xfer_wiz = (
|
||||||
self.env["ebics.xfer"]
|
self.env["ebics.xfer"]
|
||||||
.with_context(ebics_download=True)
|
.with_context(ebics_download=True)
|
||||||
@ -158,8 +172,9 @@ class EbicsBatchLog(models.Model):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
xfer_wiz._onchange_ebics_config_id()
|
xfer_wiz._onchange_ebics_config_id()
|
||||||
|
xfer_wiz.ebics_userid_id = ebics_userid
|
||||||
res = xfer_wiz.ebics_download()
|
res = xfer_wiz.ebics_download()
|
||||||
file_ids = res["context"].get("ebics_file_ids")
|
file_ids = res["context"].get("ebics_file_ids", [])
|
||||||
if res["context"]["err_cnt"]:
|
if res["context"]["err_cnt"]:
|
||||||
import_dict["errors"].append(xfer_wiz.note)
|
import_dict["errors"].append(xfer_wiz.note)
|
||||||
return file_ids
|
return file_ids
|
||||||
|
Loading…
Reference in New Issue
Block a user