[ADD] web_button_no_save

This commit is contained in:
Simone Rubino
2022-07-15 14:22:24 +02:00
parent b917c99d46
commit 728ce9a1bb
12 changed files with 615 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
odoo.define("web_button_no_save.FormController", function (require) {
"use strict";
var FormController = require("web.FormController");
FormController.include({
_onButtonClicked: function (event) {
var attrs = event.data.attrs;
if (attrs.no_save) {
event.stopPropagation();
this._disableButtons();
var def = this._callButtonAction(attrs, event.data.record);
def.always(this._enableButtons.bind(this));
} else {
return this._super.apply(this, arguments);
}
},
});
});