Skip to content

Commit 21c88d6

Browse files
committed
Merge PR OCA#672 into 16.0
Signed-off-by pedrobaeza
2 parents 68aa25d + c79fe74 commit 21c88d6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

vault/static/src/backend/controller.esm.js

+7
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,13 @@ patch(FormController.prototype, "vault", {
374374
return await _super(...arguments);
375375
},
376376

377+
async discard() {
378+
const _super = this._super.bind(this);
379+
if (this.model.root.resModel === "vault.entry")
380+
this.model.env.bus.trigger("RELATIONAL_MODEL:ENCRYPT_FIELDS");
381+
return await _super(...arguments);
382+
},
383+
377384
async beforeLeave() {
378385
const _super = this._super.bind(this);
379386
if (this.model.root.isDirty) await this._vaultAction();

vault/static/src/backend/fields/vault_field.esm.js

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export default class VaultField extends VaultMixin(Component) {
6565
useBus(self.env.bus, "RELATIONAL_MODEL:NEED_LOCAL_CHANGES", (ev) =>
6666
ev.detail.proms.push(self.commitChanges())
6767
);
68+
useBus(self.env.bus, "RELATIONAL_MODEL:ENCRYPT_FIELDS", () => {
69+
this.state.decrypted = false;
70+
this.showValue();
71+
});
6872
}
6973

7074
/**
@@ -174,6 +178,7 @@ export default class VaultField extends VaultMixin(Component) {
174178
const val = this.input.el.value || false;
175179
if (val !== (this.state.lastSetValue || false)) {
176180
this.state.lastSetValue = this.input.el.value;
181+
this.state.decryptedValue = this.input.el.value;
177182
await this.storeValue(val);
178183
this.props.setDirty(this.state.isDirty);
179184
}

0 commit comments

Comments
 (0)