From 9feb331eb9c76edc1849341c806783dc199aaa12 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Tue, 20 Aug 2024 07:49:47 +0200 Subject: [PATCH] [FIX] vault_share: Button to share value not showed and not working To show the button up, it is requiring a getter that is not defined on vault field. So the getter is added and make the button works correctly. Steps to reproduce the problem: 1. Go to Vault 2. Enter/Create a Vault 3. Press on entries 4. Access/Create a entry with a field The button with external link is not showed --- vault_share/static/src/backend/fields/vault_field.esm.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vault_share/static/src/backend/fields/vault_field.esm.js b/vault_share/static/src/backend/fields/vault_field.esm.js index 57190388cb..574c1075c4 100644 --- a/vault_share/static/src/backend/fields/vault_field.esm.js +++ b/vault_share/static/src/backend/fields/vault_field.esm.js @@ -11,18 +11,22 @@ import vault from "vault"; // Extend the widget to share patch(VaultField.prototype, "vault_share", { + get shareButton() { + return this.props.value; + }, /** * Share the value for an external user * * @private */ - async _onShareValue() { + async _onShareValue(ev) { + ev.stopPropagation(); const iv = await utils.generate_iv_base64(); const pin = sh_utils.generate_pin(sh_utils.PinSize); const salt = utils.generate_bytes(utils.SaltLength).buffer; const key = await utils.derive_key(pin, salt, utils.Derive.iterations); const public_key = await vault.get_public_key(); - const value = await this._decrypt(this.value); + const value = await this._decrypt(this.props.value); this.action.doAction({ type: "ir.actions.act_window",