From 9ee0904af2123d4529e062266e1cc77573789dfd Mon Sep 17 00:00:00 2001 From: "Ignacio J. Ortega" Date: Thu, 7 Nov 2024 11:15:39 +0100 Subject: [PATCH] [16.0][IMP] web_timeline - implement attribute group_edit to control group update --- web_timeline/static/src/js/timeline_renderer.js | 3 ++- web_timeline/static/src/js/timeline_view.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web_timeline/static/src/js/timeline_renderer.js b/web_timeline/static/src/js/timeline_renderer.js index aba23f760392..180ed1be773c 100644 --- a/web_timeline/static/src/js/timeline_renderer.js +++ b/web_timeline/static/src/js/timeline_renderer.js @@ -32,6 +32,7 @@ odoo.define("web_timeline.TimelineRenderer", function (require) { this.can_create = params.can_create; this.can_update = params.can_update; this.can_delete = params.can_delete; + this.can_update_group = params.can_update_group; this.min_height = params.min_height; this.date_start = params.date_start; this.date_stop = params.date_stop; @@ -202,7 +203,7 @@ odoo.define("web_timeline.TimelineRenderer", function (require) { // Drag items horizontally this.options.editable.updateTime = true; // Drag items from one group to another - this.options.editable.updateGroup = true; + this.options.editable.updateGroup = this.can_update_group; if (this.can_create && this.modelClass.data.rights.create) { this.options.onAdd = this.on_add; // Add new items by double tapping diff --git a/web_timeline/static/src/js/timeline_view.js b/web_timeline/static/src/js/timeline_view.js index 3971db4f750a..8dfbfff3d811 100644 --- a/web_timeline/static/src/js/timeline_view.js +++ b/web_timeline/static/src/js/timeline_view.js @@ -107,6 +107,7 @@ odoo.define("web_timeline.TimelineView", function (require) { this.rendererParams.can_create = toBoolDefaultTrue(attrs.create); this.rendererParams.can_update = toBoolDefaultTrue(attrs.edit); this.rendererParams.can_delete = toBoolDefaultTrue(attrs.delete); + this.rendererParams.can_update_group = toBoolDefaultTrue(attrs.group_edit); this.rendererParams.date_start = date_start; this.rendererParams.date_stop = date_stop; this.rendererParams.date_delay = date_delay;