Commit 855928f3 authored by Pedro M. Baeza's avatar Pedro M. Baeza Committed by GitHub
Browse files

Merge pull request #521 from monksoftware/10.0-web_timeline

[10.0] [MIG] web_timeline
parents 9da24e83 c911fcd7
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.
This directory caches those eggs to prevent repeated downloads.
However, it is safe to delete this directory.
\ No newline at end of file
\ No newline at end of file
import setuptools
.. image::
:alt: License: AGPL-3
Timeline view
Define a new view displaying events in an interactive visualization chart.
The widget is based on the external library
You need to define a view with the tag <timeline> as base element. These are
the possible attributes for the tag:
* date_start (required): it defines the name of the field of type date that
contains the start of the event.
* date_end (optional): it defines the name of the field of type date that
contains the end of the event.
* date_delay (optional): it defines the name of the field of type date that
contains the end of the event.
* default_group_by (required): it 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.
* event_open_popup (optional): when set to true, it allows to edit the events
in a popup. If not (default value), the record is edited changing to form
* colors (optional): it allows to set certain specific colors if the expressed
condition (JS syntax) is met.
You also need to declare the view in an action window of the involved model.
.. code-block:: xml
<?xml version="1.0" encoding="utf-8"?>
<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_start"
colors="#ec7063:user_id == false;#2ecb71:kanban_state=='done';">
<record id="project.action_view_task" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,calendar,gantt,timeline,graph</field>
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.
.. image::
:alt: Try me on Runbot
Known issues / Roadmap
* Implement support for vis.js timeline range item addition (with Ctrl key
* Implement a more efficient way of refreshing timeline after a record update.
Bug Tracker
Bugs are tracked on `GitHub Issues
<>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
* Odoo Community Association: `Icon <>`_.
* Laurent Mignon <>
* Adrien Peiffer <>
* Pedro M. Baeza <>
* Leonardo Donelli <>
.. image::
:alt: Odoo Community Association
This module is maintained by the OCA.
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.
To contribute to this module, please visit
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<>)
# License AGPL-3.0 or later (
from . import models
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<>)
# License AGPL-3.0 or later (
'name': "Web timeline",
'summary': "Interactive visualization chart to show events in time",
"version": "",
'author': 'ACSONE SA/NV, '
'Tecnativa, '
'Monk Software, '
'Odoo Community Association (OCA)',
"category": "web",
"website": "",
'depends': [
'qweb': [
'data': [
# -*- coding: utf-8 -*-
# © 2016 ACSONE SA/NV (<>)
# License AGPL-3.0 or later (
from . import ir_view
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<>)
# License AGPL-3.0 or later (
from openerp import fields, models
TIMELINE_VIEW = ('timeline', 'Timeline')
class IrUIView(models.Model):
_inherit = 'ir.ui.view'
type = fields.Selection(selection_add=[TIMELINE_VIEW])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment