mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-23 20:52:04 +00:00
Merge pull request #11 from Noviat/16.0
Syncing from upstream Noviat/account_ebics (16.0)
This commit is contained in:
commit
4d22e409db
@ -403,23 +403,15 @@ class EbicsUserID(models.Model):
|
|||||||
else:
|
else:
|
||||||
lang = self.env.user.lang or self.env["res.lang"].search([])[0].code
|
lang = self.env.user.lang or self.env["res.lang"].search([])[0].code
|
||||||
lang = lang[:2]
|
lang = lang[:2]
|
||||||
tmp_dir = os.path.normpath(self.ebics_config_id.ebics_keys + "/tmp")
|
|
||||||
if not os.path.isdir(tmp_dir):
|
|
||||||
os.makedirs(tmp_dir, mode=0o700)
|
|
||||||
fn_date = fields.Date.today().isoformat()
|
fn_date = fields.Date.today().isoformat()
|
||||||
fn = "_".join([self.ebics_config_id.ebics_host, "ini_letter", fn_date]) + ".pdf"
|
fn = "_".join([self.ebics_config_id.ebics_host, "ini_letter", fn_date]) + ".pdf"
|
||||||
full_tmp_fn = os.path.normpath(tmp_dir + "/" + fn)
|
letter = user.create_ini_letter(bankname=ebics_config_bank.name, lang=lang)
|
||||||
user.create_ini_letter(
|
self.write(
|
||||||
bankname=ebics_config_bank.name, path=full_tmp_fn, lang=lang
|
{
|
||||||
|
"ebics_ini_letter": base64.encodebytes(letter),
|
||||||
|
"ebics_ini_letter_fn": fn,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
with open(full_tmp_fn, "rb") as f:
|
|
||||||
letter = f.read()
|
|
||||||
self.write(
|
|
||||||
{
|
|
||||||
"ebics_ini_letter": base64.encodebytes(letter),
|
|
||||||
"ebics_ini_letter_fn": fn,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return self.write({"state": "init"})
|
return self.write({"state": "init"})
|
||||||
|
|
||||||
@ -479,9 +471,6 @@ class EbicsUserID(models.Model):
|
|||||||
raise UserError(error) from err
|
raise UserError(error) from err
|
||||||
|
|
||||||
public_bank_keys = public_bank_keys.encode()
|
public_bank_keys = public_bank_keys.encode()
|
||||||
tmp_dir = os.path.normpath(self.ebics_config_id.ebics_keys + "/tmp")
|
|
||||||
if not os.path.isdir(tmp_dir):
|
|
||||||
os.makedirs(tmp_dir, mode=0o700)
|
|
||||||
fn_date = fields.Date.today().isoformat()
|
fn_date = fields.Date.today().isoformat()
|
||||||
fn = (
|
fn = (
|
||||||
"_".join([self.ebics_config_id.ebics_host, "public_bank_keys", fn_date])
|
"_".join([self.ebics_config_id.ebics_host, "public_bank_keys", fn_date])
|
||||||
|
Loading…
Reference in New Issue
Block a user