mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-27 14:37:25 +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
|
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.
|
- 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):
|
def change_passphrase(self):
|
||||||
self.ensure_one()
|
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."))
|
raise UserError(_("Incorrect old passphrase."))
|
||||||
if self.new_pass != self.new_pass_check:
|
if self.new_pass != self.new_pass_check:
|
||||||
raise UserError(_("New passphrase verification error."))
|
raise UserError(_("New passphrase verification error."))
|
||||||
if self.new_pass == self.ebics_userid_id.ebics_passphrase:
|
if self.new_pass == self.ebics_userid_id.ebics_passphrase:
|
||||||
raise UserError(_("New passphrase equal to old passphrase."))
|
raise UserError(_("New passphrase equal to old passphrase."))
|
||||||
try:
|
try:
|
||||||
|
passphrase = (
|
||||||
|
self.ebics_userid_id.ebics_passphrase_store
|
||||||
|
and self.ebics_userid_id.ebics_passphrase
|
||||||
|
or self.old_pass
|
||||||
|
)
|
||||||
keyring = EbicsKeyRing(
|
keyring = EbicsKeyRing(
|
||||||
keys=self.ebics_userid_id.ebics_keys_fn,
|
keys=self.ebics_userid_id.ebics_keys_fn,
|
||||||
passphrase=self.ebics_userid_id.ebics_passphrase,
|
passphrase=passphrase,
|
||||||
)
|
)
|
||||||
keyring.change_passphrase(self.new_pass)
|
keyring.change_passphrase(self.new_pass)
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
|
Loading…
Reference in New Issue
Block a user