mirror of
				https://github.com/brain-tec/account_ebics.git
				synced 2025-11-04 07:00:35 +00:00 
			
		
		
		
	[IMP]account_ebics UI improvements
This commit is contained in:
		@@ -284,21 +284,28 @@ class EbicsUserID(models.Model):
 | 
				
			|||||||
        if self.signature_class == "T":
 | 
					        if self.signature_class == "T":
 | 
				
			||||||
            self.swift_3skey = False
 | 
					            self.swift_3skey = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @api.onchange("ebics_passphrase_store")
 | 
					    @api.onchange("ebics_passphrase_store", "ebics_passphrase")
 | 
				
			||||||
    def _onchange_ebics_passphrase_store(self):
 | 
					    def _onchange_ebics_passphrase_store(self):
 | 
				
			||||||
        if self.ebics_passphrase_store:
 | 
					        if self.ebics_passphrase_store:
 | 
				
			||||||
            # check passphrase before db store
 | 
					            if self.ebics_passphrase:
 | 
				
			||||||
            keyring_params = {
 | 
					                # check passphrase before db store
 | 
				
			||||||
                "keys": self.ebics_keys_fn,
 | 
					                keyring_params = {
 | 
				
			||||||
                "passphrase": self.ebics_passphrase,
 | 
					                    "keys": self.ebics_keys_fn,
 | 
				
			||||||
            }
 | 
					                    "passphrase": self.ebics_passphrase,
 | 
				
			||||||
            try:
 | 
					                }
 | 
				
			||||||
                # TODO: implement check passphrase logic
 | 
					                keyring = EbicsKeyRing(**keyring_params)
 | 
				
			||||||
                keyring = EbicsKeyRing(**keyring_params)  # noqa: F841
 | 
					                try:
 | 
				
			||||||
            except Exception as err:
 | 
					                    # fintech <= 7.4.3 does not have a call to check if a
 | 
				
			||||||
                raise UserError(str(err)) from err
 | 
					                    # passphrase matches with the value stored in the keyfile.
 | 
				
			||||||
        elif not self.ebics_passphrase_store and self.state != "draft":
 | 
					                    # We get around this limitation as follows:
 | 
				
			||||||
            self.ebics_passphrase = False
 | 
					                    # Get user keys to check for valid passphrases
 | 
				
			||||||
 | 
					                    # It will raise a ValueError on invalid passphrases
 | 
				
			||||||
 | 
					                    keyring["#USER"]
 | 
				
			||||||
 | 
					                except ValueError as err:  # noqa: F841
 | 
				
			||||||
 | 
					                    raise UserError(_("Passphrase mismatch."))  # noqa: B904
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            if self.state != "draft":
 | 
				
			||||||
 | 
					                self.ebics_passphrase = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @api.onchange("swift_3skey")
 | 
					    @api.onchange("swift_3skey")
 | 
				
			||||||
    def _onchange_swift_3skey(self):
 | 
					    def _onchange_swift_3skey(self):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user