summaryrefslogtreecommitdiff
path: root/addons/timer/static/src/js/timer_toggle_button.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/timer/static/src/js/timer_toggle_button.js')
-rw-r--r--addons/timer/static/src/js/timer_toggle_button.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/timer/static/src/js/timer_toggle_button.js b/addons/timer/static/src/js/timer_toggle_button.js
index 544c6219940..1bb5c2185d7 100644
--- a/addons/timer/static/src/js/timer_toggle_button.js
+++ b/addons/timer/static/src/js/timer_toggle_button.js
@@ -50,10 +50,13 @@ const TimerToggleButton = FieldToggleBoolean.extend({
* @param {MouseEvent} event
*/
_onToggleButton: async function (event) {
+ const context = this.record.getContext();
+ const prevent_deletion = this.attrs.options && this.attrs.options.prevent_deletion || false;
event.stopPropagation();
const result = await this._rpc({
model: this.model,
method: this._getActionButton(),
+ context: $.extend({}, context, {prevent_deletion: prevent_deletion}),
args: [this.res_id]
});