Browse Source

only switch to readonly if save is successful

pull/295/head
NetItUp-CarloToso 2 years ago
parent
commit
e61ad9edce
  1. 6
      edit_save_button/static/src/views/form/form_controller.js

6
edit_save_button/static/src/views/form/form_controller.js

@ -30,10 +30,12 @@ patch(FormController.prototype, "save", {
data = true;
await this.model.root.switchMode("edit");
},
async saveButtonClicked(params = {}){
this._super();
async saveButtonClicked(params = {}) {
let saved = await this._super();
data = false;
if (saved) {
await this.model.root.switchMode("readonly");
}
},
async discard() {
this._super();

Loading…
Cancel
Save