Browse Source

Merge pull request #1134 from invitu/12.0-web_timeline_add_stack_support

[web_timeline][IMP] Add stack support
pull/1137/head
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
d26ff17f8e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      web_timeline/README.rst
  2. 2
      web_timeline/__manifest__.py
  3. 5
      web_timeline/static/src/js/timeline_view.js

2
web_timeline/README.rst

@ -58,6 +58,8 @@ the possible attributes for the tag:
+--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| event_open_popup | No | When set to true, it allows to edit the events in a popup. If not (default value), the record is edited changing to form view. | | event_open_popup | No | When set to true, it allows to edit the events in a popup. If not (default value), the record is edited changing to form view. |
+--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| stack | No | When set to false, items will not be stacked on top of each other such that they do overlap. |
+--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| colors | No | Allows to set certain specific colors if the expressed condition (JS syntax) is met. | | colors | No | Allows to set certain specific colors if the expressed condition (JS syntax) is met. |
+--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| dependency_arrow | No | Set this attribute to a x2many field to draw arrows between the records referenced in the x2many field. | | dependency_arrow | No | Set this attribute to a x2many field to draw arrows between the records referenced in the x2many field. |

2
web_timeline/__manifest__.py

@ -4,7 +4,7 @@
{ {
'name': "Web timeline", 'name': "Web timeline",
'summary': "Interactive visualization chart to show events in time", 'summary': "Interactive visualization chart to show events in time",
"version": "12.0.1.0.0",
"version": "12.0.1.0.1",
"development_status": "Production/Stable", "development_status": "Production/Stable",
'author': 'ACSONE SA/NV, ' 'author': 'ACSONE SA/NV, '
'Tecnativa, ' 'Tecnativa, '

5
web_timeline/static/src/js/timeline_view.js

@ -111,12 +111,17 @@ odoo.define('web_timeline.TimelineView', function (require) {
if (!isNullOrUndef(attrs.quick_create_instance)) { if (!isNullOrUndef(attrs.quick_create_instance)) {
self.quick_create_instance = 'instance.' + attrs.quick_create_instance; self.quick_create_instance = 'instance.' + attrs.quick_create_instance;
} }
this.stack = true;
if (!isNullOrUndef(attrs.stack) && !_.str.toBoolElse(attrs.stack, "true")) {
this.stack = false;
}
this.options = { this.options = {
groupOrder: this.group_order, groupOrder: this.group_order,
orientation: 'both', orientation: 'both',
selectable: true, selectable: true,
multiselect: true, multiselect: true,
showCurrentTime: true, showCurrentTime: true,
stack: this.stack,
zoomKey: this.zoomKey zoomKey: this.zoomKey
}; };
if (isNullOrUndef(attrs.event_open_popup) || !_.str.toBoolElse(attrs.event_open_popup, true)) { if (isNullOrUndef(attrs.event_open_popup) || !_.str.toBoolElse(attrs.event_open_popup, true)) {

Loading…
Cancel
Save