mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-23 20:52:04 +00:00
[FIX][16.0]fix change passphrase for non-stored paspphrase
This commit is contained in:
parent
dc24651678
commit
898f371c77
@ -213,6 +213,6 @@ You can also find this information in the doc folder of this module (file EBICS_
|
||||
Known Issues / Roadmap
|
||||
======================
|
||||
|
||||
- add support to import externally generated keys & certificates (currently only 3SKey signature certificate)
|
||||
- add support to import externally generated keys & certificates (currently only 3SKey signature certificate).
|
||||
- For Odoo 16.0 the interaction with the OCA payment order and bank statement import modules (e.g. french CFONB) is not yet available.
|
||||
|
||||
|
@ -31,16 +31,24 @@ class EbicsChangePassphrase(models.TransientModel):
|
||||
|
||||
def change_passphrase(self):
|
||||
self.ensure_one()
|
||||
if self.old_pass != self.ebics_userid_id.ebics_passphrase:
|
||||
if (
|
||||
self.ebics_userid_id.ebics_passphrase_store
|
||||
and self.old_pass != self.ebics_userid_id.ebics_passphrase
|
||||
):
|
||||
raise UserError(_("Incorrect old passphrase."))
|
||||
if self.new_pass != self.new_pass_check:
|
||||
raise UserError(_("New passphrase verification error."))
|
||||
if self.new_pass == self.ebics_userid_id.ebics_passphrase:
|
||||
raise UserError(_("New passphrase equal to old passphrase."))
|
||||
try:
|
||||
passphrase = (
|
||||
self.ebics_userid_id.ebics_passphrase_store
|
||||
and self.ebics_userid_id.ebics_passphrase
|
||||
or self.old_pass
|
||||
)
|
||||
keyring = EbicsKeyRing(
|
||||
keys=self.ebics_userid_id.ebics_keys_fn,
|
||||
passphrase=self.ebics_userid_id.ebics_passphrase,
|
||||
passphrase=passphrase,
|
||||
)
|
||||
keyring.change_passphrase(self.new_pass)
|
||||
except ValueError as err:
|
||||
|
Loading…
Reference in New Issue
Block a user