Skip to content

Commit

Permalink
[16.0][IMP] web_timeline - implement attribute edit_group to control …
Browse files Browse the repository at this point in the history
…group update
  • Loading branch information
IJOL committed Nov 7, 2024
1 parent a73351b commit 846bd53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web_timeline/static/src/js/timeline_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions web_timeline/static/src/js/timeline_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.edit_group);
this.rendererParams.date_start = date_start;
this.rendererParams.date_stop = date_stop;
this.rendererParams.date_delay = date_delay;
Expand Down

0 comments on commit 846bd53

Please sign in to comment.