mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_button_no_save
This commit is contained in:
19
web_button_no_save/static/src/js/web_button_no_save.js
Normal file
19
web_button_no_save/static/src/js/web_button_no_save.js
Normal 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);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user