Browse Source

Merge da703d88c2 into 82265ff62f

pull/295/merge
NetItUp-CarloToso 1 year ago
committed by GitHub
parent
commit
2e600613ee
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      edit_save_button/static/src/views/form/form_controller.js

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

@ -19,7 +19,7 @@ odoo.__DEBUG__ && console.log("Console log inside the patch function", FormContr
patch(FormController.prototype, "save", {
setup() {
this.props.preventEdit = this.env.inDialog ? false :true;
this.props.preventEdit = !this.env.inDialog;
this._super();
},
@ -28,17 +28,19 @@ patch(FormController.prototype, "save",{
await this.model.root.switchMode("edit");
},
async saveButtonClicked(params = {}) {
this._super();
if (this.env.inDialog == false){
const saved = await this._super();
if (saved) {
if (!this.env.inDialog){
await this.model.root.switchMode("readonly");
}
else {
this.model.actionService.doAction({type: 'ir.actions.act_window_close'});
}
}
},
async discard() {
this._super();
if (this.env.inDialog == false){
if (!this.env.inDialog){
await this.model.root.switchMode("readonly");
}
else {

Loading…
Cancel
Save