[FIX]fix handling of non-stored passphrases

module: account_ebics 16.0

The non-stored passphrases (passphrase, sig_passphrase) were incorrectly handled
during the INIT cycle:
- setting 'ebics_passphrase_store' during INIT cycle didn't work
- setting the 'ebics_sig_passphrase' during INIT cycle didn't work
This commit is contained in:
Luc De Meyer
2023-12-09 11:22:17 +01:00
parent 621042bd8a
commit 71005cd863
3 changed files with 64 additions and 30 deletions

View File

@@ -89,9 +89,15 @@ class EbicsChangePassphrase(models.TransientModel):
raise UserError(str(err)) from err
if self.new_pass:
self.ebics_userid_id.ebics_passphrase = self.new_pass
self.ebics_userid_id.ebics_passphrase = (
self.ebics_userid_id.ebics_passphrase_store and self.new_pass
)
self.note += "The EBICS Passphrase has been changed."
if self.new_sig_pass:
# removing ebics_sig_passphrase from db should not be required
# but we do it for double safety
if self.ebics_userid_id.ebics_sig_passphrase:
self.ebics_userid_id.ebics_sig_passphrase = False
self.note += "The EBICS Signature Passphrase has been changed."
module = __name__.split("addons.")[1].split(".")[0]