Commit Graph

28 Commits (8de0b1776bfc9db460f0aed2a03cb490ce8ff973)

Author SHA1 Message Date
Houzéfa Abbasbhay 8de0b1776b [IMP] web_timeline: Follow create/edit/delete attrs
In addition to security rights (was already implemented), now follow
`create="0"` / `edit="0"` / `delete="0"` attributes one can set onto the
`timeline` tag, same as in other Odoo views.
2025-04-01 11:46:28 +05:30
Houzéfa Abbasbhay 6f514424be [FIX] web_timeline: Redraw issues with initial mode
This commit fixes redraw issues when setting a `mode` attribute in the
`timeline` view tag.

This mode specifies a default scale one would want to set; same as when
clicking on Day/Week/Month buttons at the top of the view.

Initial rendering had issues here because data was loaded too soon,
before the timeline component was rendered/ready. The fix is to load
data into the component only after initial redraw event, called
`changed` (see <https://visjs.github.io/vis-timeline/docs/timeline/#Events>).

There was old code attempting to call `on_scale_xxx_clicked` methods at
load time to simulate clicks on these Day/Week/Month buttons, but these
methods have been renamed so this code is no longer working.

This commit also removes the `current_window` instance variable, not
needed and actually confusing as the timeline component already
maintains its own start/end information (which we can query with
`timeline.getWindow()`).
2025-04-01 11:46:28 +05:30
Houzéfa Abbasbhay 02c8da9abb [IMP] web_timeline: Align to top instead of bottom
This avoids somewhat ugly very large "Unassigned" first row.
2025-04-01 11:46:28 +05:30
Houzéfa Abbasbhay 2217472893 [IMP] web_timeline: Overflow text, add hover colors
When an item label does not fit in its date-range box, overflow
according to
https://visjs.github.io/vis-timeline/examples/timeline/items/rangeOverflowItem.html

Previous CSS code was already trying to do that, but was selecting
`.vis-item.vis-item-content` instead of `.vis-item .vis-item-content`.

Displaying overflow text brings up layout issues solved by removing the
forced-100% width instruction.

This change also adds highlight when hovering a box, which is useful on
text that has overflown (as it has no borders).
2025-04-01 11:46:28 +05:30
Houzéfa Abbasbhay 0e11828513 [IMP] web_timeline: Add demo view on cron tasks
This way we can showcase this module without project_timeline.
2025-04-01 11:46:28 +05:30
Houzéfa Abbasbhay 0572c797d9 [FIX] web_timeline: Wrap fields_get arg into a list
By contract the first argument of the `fields_get` method is supposed to
be a list. Before this fix, `web_timeline` would call `fields_get` with
a string instead of a list.

Fortunately in case only 1 field is being grouped, this worked as Odoo
does an `x in y` comparison in its `fields_get` implementation, which
does pass in a simple `"project_id" in "project_id"` case.

But that call remains invalid and can break when `fields_get` has been
tweaked by other modules.
2025-04-01 11:46:28 +05:30
Henrik Norlin ba8c1c42c0 [FIX] web_timeline: date_delay = date_stop - date_start 2025-04-01 11:46:28 +05:30
anjeel.haria 42807dd5f8 [MIG] web_timeline: Migration to 16.0
Syntax changes

Syntax changes
2025-04-01 11:46:28 +05:30
CarlosRoca13 ee1e65db87 [FIX] web_timeline: Allow groupby m2m fields 2025-04-01 11:46:28 +05:30
Murtaza Mithaiwala d441894bbd [14.0][MIG] Migrated web_timeline. 2025-04-01 11:46:28 +05:30
Alexandre Díaz 86df694ef7 [MIG] web_timeline: Finish migration to 13.0 2025-04-01 11:46:28 +05:30
Thong Nguyen Van f07afdc0d9 [MIG] web_timeline: Migration to 13.0 2025-04-01 11:46:28 +05:30
Cyril VINH-TUNG 4deef7a977 [web_timeline][IMP] Add margin support in web_timeline (#1135) 2025-04-01 11:46:28 +05:30
invitu e7f9bc5f94 [FIX] web_timeline: fix readme - To be squashed with previous one on migration (#1137) 2025-04-01 11:46:28 +05:30
tarteo 0f0aefd040 [IMP] Readme: Available attribute list 2025-04-01 11:46:28 +05:30
tarteo 4d6acd98b9 [MIG] web_timeline: Migration to 12.0 2025-04-01 11:46:28 +05:30
Dennis Sluijk a7aec98aae [ADD] Enable multiselect
[IMP] Prevent flickering

[IMP] Fixed headers

[ADD] Create new record by date range selection

Remove roadmap item from readme

[FIX] minimal height
2025-04-01 11:46:28 +05:30
tarteo 2340d64570 [ADD] web_timeline: New dependency_arrow attribute
Update README.rst

[FIX] Remove console.log

[ADD] Make timeline.fit optional

[FIX] Use stringified points

[IMP] Reversed the arrow head and fixed lint issues

[IMP] Use options parameter for line color and width

[FIX] Version number

[IMP] Minor improvements
2025-04-01 11:46:28 +05:30
tarteo 81d645bcfb [ADD] field_utils to web_timeline
[UPD] Version number

[UPD] README
2025-04-01 11:46:28 +05:30
tarteo 549a289b13 [IMP] web_timeline: Templates implementation like kanban
[IMP] web_timeline: Templates implementation like kanban

[ADD] Check if template exists

Update README.rst
2025-04-01 11:46:28 +05:30
Martin Nicolas Cuesta f809890d16 [MIG] web_timeline module from v10 to v11
* Update Version in Manifest
* Remove enconding in .py files
* Rewrite the view definition according to version 11
2025-04-01 11:46:28 +05:30
adrien.didenot eae010cd90 [IMP] change the option to initialize the timeline window on display.
Change the attribute 'default_window' to 'mode' like the Odoo calendar view (to be iso functional)
2025-04-01 11:46:28 +05:30
adrien.didenot c914c58f19 [IMP] Add an option to initialize the timeline window on display.
The default window display all the events (aka 'fit'), in case of events spread over the year, the events are invisibles (too small to be readable)

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
2025-04-01 11:46:28 +05:30
adrien.didenot 6dd02366ee [Fix OCA/project#317] Add the property date_delay to TimeLine views (same as base Calendar view)
In Odoo calendar view, the attribute date_delay is an alternative to date_stop, to provides the duration of the event instead of its end date.
This commit integrate this attribute to the Timeline view, but contrary to the base Calendar view the Timeline view could use both arguments (date_stop and date_delay) simultaneously.

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
2025-04-01 11:46:28 +05:30
adrien.didenot c6fc009e7f [10.0][IMP] web_timeline improvements:
* Update the vis.js framework to latest stable version (v4.20.1) to add new functionality and save almost
400ko of source code in odoo assets (the vis dev team has isolate the code for timeline widget from the
 rest of their widgets)

* Add the possibility to display events with no duration (instantaneous) as the same time has regular events

* Add the possibility to choose between two scroll mode :
  -  zoom in time resolution (default)
  or
  -  vertical scroll (web browser default behaviour)

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
2025-04-01 11:46:28 +05:30
Pedro M. Baeza 1e816adcb7 [MIG] web_timeline: Migration to 9.0 2025-04-01 11:46:28 +05:30
Adrien Peiffer (ACSONE) 0e3e15379b [IMP] web_timeline: Several improvements:
* Avoid to display all items of group_by model
* Remove unnecessary readgroup
* Remove dependency on project. Modify module structure. Imporve readme file.
* Add setup.py
2025-04-01 11:46:28 +05:30
Laurent Mignon 502a8c88db [IMP] web_timeline: Extracted from incubator 2025-04-01 11:46:28 +05:30