Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
f005013
[IMP] web_timeline: Extracted from incubator
lmignon Feb 7, 2016
482ab37
[IMP] web_timeline: Several improvements:
Apr 8, 2016
26424f8
[IMP] web_timeline: add few features
hbrunn Jun 16, 2016
ab4fabd
[MIG] web_timeline: Migration to 9.0
pedrobaeza Aug 1, 2016
fd66458
[FIX] web_timeline: fix commas in manifest file
ThomasBinsfeld May 4, 2017
543cafb
[10.0] [FIX] [web_timeline] Correct write when grouped by (#678)
JBF91 Aug 17, 2017
c4adc87
[10.0][IMP] web_timeline improvements:
Creamaster Sep 27, 2017
0d675ae
[Fix OCA/project#317] Add the property date_delay to TimeLine views (…
Creamaster Sep 28, 2017
2a70d96
[IMP] Add an option to initialize the timeline window on display.
Creamaster Sep 28, 2017
f68ce1a
[IMP] change the option to initialize the timeline window on display.
Creamaster Oct 11, 2017
fd5b9db
Fixed web_timeline.css
npiganeau Nov 29, 2017
a71440d
[MIG] web_timeline module from v10 to v11
Maartincm Apr 13, 2018
da7b558
[FIX] Missing GroupClick Functionality
Maartincm Apr 17, 2018
2a1203a
[FIX] web_timeline: Make colors attribute optional (#969)
tarteo Jun 28, 2018
f4909a2
[IMP] web_timeline: Templates implementation like kanban
tarteo Jul 17, 2018
0aacb54
[ADD] field_utils to web_timeline
tarteo Jul 27, 2018
e104494
[ADD] web_timeline: New dependency_arrow attribute
tarteo Aug 17, 2018
874eb15
[ADD] Enable multiselect
tarteo Aug 24, 2018
b94d7f0
[MIG] web_timeline: Migration to 12.0
tarteo Oct 23, 2018
2587ba4
[IMP] Readme: Available attribute list
tarteo Oct 31, 2018
6e4543d
[IMP] Add stack support
Dec 18, 2018
551ee89
[FIX] web_timeline: fix readme - To be squashed with previous one on …
Dec 21, 2018
b20a039
[web_timeline][IMP] Add margin support in web_timeline (#1135)
cvinh Jan 8, 2019
f18f3e7
[FIX] web_timeline: Reloading view
tarteo Jan 16, 2019
66bf29f
[12.0][FIX]web_timeline: fix group orders
denislour Jun 28, 2019
e3bf8ff
[12.0][web_timeline] Fix bug from group_order: locale instead locate.
denislour Jul 1, 2019
85f3b74
[FIX][12.0] web_timeline: Scroll Issue.
hpatelserpentcs Jul 10, 2019
120f483
[IMP] web_timeline: black, isort
thoongnv Dec 30, 2019
07936eb
[MIG] web_timeline: Migration to 13.0
thoongnv Dec 30, 2019
e55ff3d
[MIG] web_timeline: Finish migration to 13.0
Tardo Mar 23, 2020
a7a9d0b
[FIX] web_timeline: Change vis-timeline library import
Tardo May 6, 2020
01e54d2
[IMP] web_timeline: CSS vis items
Tardo May 6, 2020
aaf7a9a
[FIX] web_timeline: Change draw_dependencies
Tardo May 8, 2020
78cd077
[FIX] Travis
Murtaza-OSI Mar 15, 2021
8cdcbf4
[14.0][MIG] Migrated web_timeline.
Murtaza-OSI Mar 15, 2021
0a8b435
[MIG] web_timeline: Migration to 15.0
cesar-tecnativa Jul 5, 2022
43ce2c0
[FIX] web_timeline: Don't crash when restoring timeline from breadcrumb
hbrunn Jul 18, 2022
c9b1605
[FIX] web_timeline: Allow groupby m2m fields
CarlosRoca13 Aug 2, 2022
75e242d
[IMP] web_timeline: allow UNASSIGNED grouping when using M2M field
Aug 2, 2022
3b3fa79
[FIX] web_timeline: order group_by field
alexis-via Aug 2, 2022
34bf060
Update vis-timeline-graph2d lib: 7.3.4 -> 7.7.0
alexis-via Aug 2, 2022
ee6e6d6
[UPD] Update web_timeline.pot
Aug 4, 2022
6abe642
[FIX] web_timeline: utc and create_completed
jguenat Sep 14, 2022
cb0dc1d
[FIX] web_timeline: updateProm.finally is not a function
jguenat Oct 29, 2022
25c7c46
[MIG] web_timeline: Migration to 16.0
bvanjeelharia Mar 1, 2023
afa851e
Added translation using Weblate (Turkish)
tate11 Mar 6, 2023
61bdd83
Translated using Weblate (Croatian)
badbole Apr 3, 2023
567946d
[FIX] web_timeline: css and styles not charged when rendering timeline
Yadier-Tecnativa Jun 2, 2023
d68ebc0
[FIX] web_timeline: Add record - FormViewDialog - resId: null -> fals…
norlinhenrik Aug 29, 2023
221db00
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
c1252ff
[FIX] web_timeline: date_delay = date_stop - date_start
norlinhenrik Aug 31, 2023
2b3bb05
Update translation files
weblate Oct 9, 2023
a0ea3da
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 28, 2023
ffec5c8
Added translation using Weblate (Italian)
mymage Nov 27, 2023
e32852d
Translated using Weblate (French)
houzefa-abba Jan 11, 2024
6fd7547
[FIX] web_timeline: Wrap fields_get arg into a list
houzefa-abba Jan 8, 2024
6f8ee0e
[IMP] web_timeline: Add demo view on cron tasks
houzefa-abba Mar 21, 2024
44afaa6
[IMP] web_timeline: Overflow text, add hover colors
houzefa-abba Mar 21, 2024
faa603d
[IMP] web_timeline: Handle inverted date ranges
houzefa-abba Mar 21, 2024
2db28cb
[IMP] web_timeline: Align to top instead of bottom
houzefa-abba Apr 3, 2024
4484899
[FIX] web_timeline: Redraw issues with initial mode
houzefa-abba Mar 21, 2024
be9a32e
[IMP] web_timeline: Follow create/edit/delete attrs
houzefa-abba Apr 4, 2024
ccbad0d
[IMP] web_timeline: pre-commit auto fixes
carlos-lopez-tecnativa Oct 2, 2024
6dc97ad
[MOVE] web_timeline: new folder structure according Odoo guideslines
carlos-lopez-tecnativa Oct 2, 2024
2318cea
[MIG] web_timeline: Migration to 17.0
carlos-lopez-tecnativa Oct 6, 2024
8b47831
[UPD] Update web_timeline.pot
Oct 21, 2024
d2644af
[BOT] post-merge updates
OCA-git-bot Oct 21, 2024
340725e
Update translation files
weblate Oct 21, 2024
6303212
Translated using Weblate (Italian)
mymage Oct 22, 2024
5452338
[IMP] web_timeline: Update vis-timeline-graph2d lib: 7.7.0 -> 7.7.3
carlos-lopez-tecnativa Oct 23, 2024
34f7a7c
[BOT] post-merge updates
OCA-git-bot Oct 30, 2024
6207838
[IMP] web_timeline: black, isort, prettier
JasminSForgeFlow Mar 28, 2025
f20d462
[MIG] web_timeline: Migration to 18.0
JasminSForgeFlow Mar 28, 2025
c8bbcef
[FIX] web_timeline: Enable XSS filtering with whitelist for safer HTM…
carlos-lopez-tecnativa May 9, 2025
5ea7e07
[FIX] web_timeline: Add <b> element to XSS whitelist for safer HTML r…
carlos-lopez-tecnativa May 13, 2025
101ace8
[UPD] Update web_timeline.pot
May 13, 2025
9dc716c
[BOT] post-merge updates
OCA-git-bot May 13, 2025
19c0a2c
[FIX] web_timeline: avoid sorting by many2many fields
carlos-lopez-tecnativa May 16, 2025
a57145c
[BOT] post-merge updates
OCA-git-bot May 17, 2025
b1a7e11
[FIX] web_timeline: Render the SVG correctly to draw dependencies pro…
carlos-lopez-tecnativa Jan 29, 2026
0ef318e
[BOT] post-merge updates
OCA-git-bot Jan 30, 2026
cb944c2
[REM] web_timeline: Maintainer
SirPyTech Feb 26, 2026
441d754
[BOT] post-merge updates
OCA-git-bot Feb 26, 2026
a13ff96
[IMP] web_timeline: Safer demo view action override
houzefa-abba Jan 30, 2025
b85f82b
[IMP] web_timeline: Allow to select in action's view_ids
SirPyTech Feb 18, 2026
fd9b21b
[BOT] post-merge updates
OCA-git-bot Mar 17, 2026
2501360
Translated using Weblate (Spanish)
Ed-Spain Apr 13, 2026
9f540d9
[MIG] web_timeline: Migration to 19.0
Yusuke1998 Apr 22, 2026
cc6bbcd
[FIX] checklog-odoo: ignore Chrome zombie cleanup warnings in CI
Yusuke1998 Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checklog-odoo.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[checklog-odoo]
ignore=
WARNING.* 0 failed, 0 error\(s\).*
WARNING.*Killing chrome descendants-or-self.*
308 changes: 308 additions & 0 deletions web_timeline/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============
Web timeline
============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8633bbe9e07663ef50a7093c48c70557768324805e053637d2794ba7fb2fc7f1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/19.0/web_timeline
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-19-0/web-19-0-web_timeline
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Define a new view displaying events in an interactive visualization
chart.

The widget is based on the external library
https://visjs.github.io/vis-timeline/examples/timeline

**Table of contents**

.. contents::
:local:

Configuration
=============

You need to define a view with the tag <timeline> as base element. These
are the possible attributes for the tag:

+------------------+-----------+--------------------------------------------------------+
| Attribute | Required? | Description |
+==================+===========+========================================================+
| date_start | **Yes** | Defines the name of the field of type date that |
| | | contains the start of the event. |
+------------------+-----------+--------------------------------------------------------+
| date_stop | No | Defines the name of the field of type date that |
| | | contains the end of the event. The date_stop can be |
| | | equal to the attribute date_start to display events |
| | | has 'point' on the Timeline (instantaneous event). |
+------------------+-----------+--------------------------------------------------------+
| date_delay | No | Defines the name of the field of type float/integer |
| | | that contain the duration in hours of the event, |
| | | default = 1. |
+------------------+-----------+--------------------------------------------------------+
| default_group_by | **Yes** | Defines the name of the field that will be taken as |
| | | default group by when accessing the view or when no |
| | | other group by is selected. |
+------------------+-----------+--------------------------------------------------------+
| zoomKey | No | Specifies whether the Timeline is only zoomed when an |
| | | additional key is down. Available values are '' (does |
| | | not apply), 'altKey', 'ctrlKey', or 'metaKey'. Set |
| | | this option if you want to be able to use the scroll |
| | | to navigate vertically on views with a lot of events. |
+------------------+-----------+--------------------------------------------------------+
| mode | No | Specifies the initial visible window. Available values |
| | | are: 'day' to display the current day, 'week', 'month' |
| | | and 'fit'. Default value is 'fit' to adjust the |
| | | visible window such that it fits all items. |
+------------------+-----------+--------------------------------------------------------+
| margin | No | Specifies the margins around the items. It should |
| | | respect the JSON format. For example |
| | | '{"item":{"horizontal":-10}}'. Available values are: |
| | | '{"axis":<number>}' (The minimal margin in pixels |
| | | between items and the time axis) '{"item":<number>}' |
| | | (The minimal margin in pixels between items in both |
| | | horizontal and vertical direction), |
| | | '{"item":{"horizontal":<number>}}' (The minimal |
| | | horizontal margin in pixels between items), |
| | | '{"item":{"vertical":<number>}}' (The minimal vertical |
| | | margin in pixels between items), |
| | | '{"item":{"horizontal":<number>,"vertical":<number>}}' |
| | | (Combination between horizontal and vertical margins |
| | | in pixels between items). |
+------------------+-----------+--------------------------------------------------------+
| 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. |
+------------------+-----------+--------------------------------------------------------+
| dependency_arrow | No | Set this attribute to a x2many field to draw arrows |
| | | between the records referenced in the x2many field. |
+------------------+-----------+--------------------------------------------------------+

Optionally you can declare a custom template, which will be used to
render the timeline items. You have to name the template
'timeline-item'. These are the variables available in template
rendering:

- ``record``: to access the fields values selected in the timeline
definition.
- ``formatters``: used to format values (see available functions in
``@web/views/fields/formatters``).
- ``parsers``: used to parse values (see available functions in
``@web/views/fields/parsers``).

You also need to declare the view in an action window of the involved
model.

See ``web_timeline/demo/ir_cron_view.xml`` for a very basic timeline
view example added onto cron tasks.

More evolved example, from ``project_timeline``:

.. code:: xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_task_timeline" model="ir.ui.view">
<field name="model">project.task</field>
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline date_start="date_assign"
date_stop="date_end"
string="Tasks"
default_group_by="project_id"
event_open_popup="true"
colors="white: user_ids == []; #2ecb71: state == '1_done'; #ec7063: state == '1_canceled'"
dependency_arrow="depend_on_ids"
>
<field name="user_ids" />
<field name="allocated_hours" />
<templates>
<t t-name="timeline-item">
<div class="o_project_timeline_item">
<t t-foreach="record.user_ids" t-as="user" t-key="user.id">
<img
t-if="record.user_ids"
t-attf-src="/web/image/res.users/#{user}/image_128/16x16"
t-att-title="record.user"
width="16"
height="16"
class="mr8"
alt="User"
/>
</t>
<span name="display_name">
<t t-esc="record.display_name" />
</span>
<small
name="allocated_hours"
class="text-info ml4"
t-if="record.allocated_hours"
>
<t
t-out="formatters.get('float_time')(record.allocated_hours)"
/>
</small>
</div>
</t>
</templates>
</timeline>
</field>
</record>

<record id="project.action_view_task" model="ir.actions.act_window">
<field
name="view_mode"
>kanban,list,form,calendar,timeline,pivot,graph,activity</field>
</record>
</odoo>

Usage
=====

For accessing the timeline view, you have to click on the button with
the clock icon in the view switcher. The first time you access to it,
the timeline window is zoomed to fit all the current elements, the same
as when you perform a search, filter or group by operation.

You can use the mouse scroll to zoom in or out in the timeline, and
click on any free area and drag for panning the view in that direction.

The records of your model will be shown as rectangles whose widths are
the duration of the event according our definition. You can select them
clicking on this rectangle. You can also use Ctrl or Shift keys for
adding discrete or range selections. Selected records are hightlighted
with a different color (but the difference will be more noticeable
depending on the background color). Once selected, you can drag and move
the selected records across the timeline.

When a record is selected, a red cross button appears on the upper left
corner that allows to remove that record. This doesn't work for multiple
records although they were selected.

Records are grouped in different blocks depending on the group by
criteria selected (if none is specified, then the default group by is
applied). Dragging a record from one block to another change the
corresponding field to the value that represents the block. You can also
click on the group name to edit the involved record directly.

Double-click on the record to edit it. Double-click in open area to
create a new record with the group and start date linked to the area you
clicked in. By holding the Ctrl key and dragging left to right, you can
create a new record with the dragged start and end date.

Known issues / Roadmap
======================

- Implement a more efficient way of refreshing timeline after a record
update;
- Make ``attrs`` attribute work;
- When grouping by m2m and more than one record is set, the timeline
item appears only on one group. Allow showing in both groups.
- When grouping by m2m and dragging for changing the time or the group,
the changes on the group will not be set, because it could make
disappear the records not related with the changes that we want to
make. When the item is showed in all groups change the value according
the group of the dragged item.
- When an item label does not fit in its date-range box: ✅ the label
correctly overflows the box; ✅ clicking anywhere on the label allows
moving the box; ❌ double-clicking the label outside of the box does
not open that item.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_timeline%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV
* Tecnativa
* Monk Software
* Onestein
* Trobz

Contributors
------------

- Laurent Mignon <laurent.mignon@acsone.eu>
- Adrien Peiffer <adrien.peiffer@acsone.eu>
- Leonardo Donelli <donelli@webmonks.it>
- Adrien Didenot <adrien.didenot@horanet.com>
- Thong Nguyen Van <thongnv@trobz.com>
- Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.com>
- Ammar Officewala <aofficewala@opensourceintegrators.com>
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Alexandre Díaz
- César A. Sánchez
- Carlos López

- `Onestein <https://www.onestein.nl>`__:

- Dennis Sluijk <d.sluijk@onestein.nl>
- Anjeel Haria

- `XCG Consulting <https://xcg-consulting.fr>`__:

- Houzéfa Abbasbhay

- `PyTech <https://www.pytech.it>`__:

- Simone Rubino <simone.rubino@pytech.it>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/web <https://github.com/OCA/web/tree/19.0/web_timeline>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions web_timeline/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
47 changes: 47 additions & 0 deletions web_timeline/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2024 Tecnativa - Carlos Lopez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Web timeline",
"summary": "Interactive visualization chart to show events in time",
"version": "19.0.1.0.0",
"development_status": "Production/Stable",
"author": "ACSONE SA/NV, "
"Tecnativa, "
"Monk Software, "
"Onestein, "
"Trobz, "
"Odoo Community Association (OCA)",
"category": "web",
"license": "AGPL-3",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"data": [],
"demo": ["demo/ir_cron_view.xml"],
"application": False,
"installable": True,
"assets": {
"web.assets_backend": [
"web_timeline/static/src/views/timeline/timeline_view.scss",
"web_timeline/static/src/views/timeline/timeline_canvas.scss",
"web_timeline/static/src/views/timeline/timeline_arch_parser.esm.js",
"web_timeline/static/src/views/timeline/timeline_view.esm.js",
"web_timeline/static/src/views/timeline/timeline_renderer.esm.js",
"web_timeline/static/src/views/timeline/timeline_renderer.xml",
"web_timeline/static/src/views/timeline/timeline_controller.esm.js",
"web_timeline/static/src/views/timeline/timeline_controller.xml",
"web_timeline/static/src/views/timeline/timeline_model.esm.js",
"web_timeline/static/src/views/timeline/timeline_canvas.esm.js",
],
"web_timeline.vis-timeline_lib": [
"/web_timeline/static/lib/vis-timeline/vis-timeline-graph2d.js",
"/web_timeline/static/lib/vis-timeline/vis-timeline-graph2d.css",
],
"web.qunit_suite_tests": [
"web_timeline/static/tests/helpers.esm.js",
"web_timeline/static/tests/web_timeline_arch_parser_tests.esm.js",
"web_timeline/static/tests/web_timeline_view_tests.esm.js",
],
},
}
27 changes: 27 additions & 0 deletions web_timeline/demo/ir_cron_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Add demo timeline view on crons so we can showcase this module without project_timeline. -->
<record id="ir_cron_timeline" model="ir.ui.view">
<field name="model">ir.cron</field>
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline date_start="nextcall" default_group_by="model_id" />
</field>
</record>
<!-- Append our view_mode this way to avoid overwriting changes done by other modules. -->
<function model="ir.actions.act_window" name="write">
<value eval="[ref('base.ir_cron_act')]" />
<value
model="ir.actions.act_window"
eval="{
'view_mode': obj().env.ref('base.ir_cron_act').view_mode + ',timeline',
'view_ids': [
Command.create({
'view_mode': 'timeline',
'view_id': ref('ir_cron_timeline'),
}),
],
}"
/>
</function>
</odoo>
Loading
Loading