Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] web_timeline: Migration to 13.0 #1470

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
ab6dd3a
[IMP] web_timeline: Extracted from incubator
lmignon Feb 7, 2016
7534b4f
[IMP] web_timeline: Several improvements:
adrienpeiffer Apr 8, 2016
ece0545
[IMP] web_timeline: add few features
hbrunn Jun 16, 2016
1c7f9c0
[MIG] web_timeline: Migration to 9.0
pedrobaeza Aug 1, 2016
35f94a0
Port web_timeline to v10
LeartS Jan 12, 2017
4b4f2d1
[FIX] web_timeline: fix commas in manifest file
ThomasBinsfeld May 4, 2017
82c3767
OCA Transbot updated translations from Transifex
oca-transbot Jul 1, 2017
81101c6
OCA Transbot updated translations from Transifex
oca-transbot Jul 15, 2017
b8ee1dc
[10.0] [FIX] [web_timeline] Correct write when grouped by (#678)
JBF91 Aug 17, 2017
4d40bbc
[10.0][IMP] web_timeline improvements:
Creamaster Sep 27, 2017
a47a6ac
Cosmetic changes (to skip or squash)
Creamaster Sep 27, 2017
af27bb0
[Fix OCA/project#317] Add the property date_delay to TimeLine views (…
Creamaster Sep 28, 2017
92b49b0
[IMP] Add an option to initialize the timeline window on display.
Creamaster Sep 28, 2017
107f0b5
[IMP] change the option to initialize the timeline window on display.
Creamaster Oct 11, 2017
3239192
Fixed web_timeline.css
npiganeau Nov 29, 2017
604e65f
OCA Transbot updated translations from Transifex
oca-transbot Jan 17, 2018
47c5c46
[MIG] web_timeline module from v10 to v11
Maartincm Apr 13, 2018
e4868d1
[FIX] Missing GroupClick Functionality
Maartincm Apr 17, 2018
d365cd8
[UPD] Update web_timeline.pot
oca-travis Jun 24, 2018
ca8def9
[FIX] web_timeline: Make colors attribute optional (#969)
tarteo Jun 28, 2018
a8355b1
[IMP] web_timeline: Templates implementation like kanban
tarteo Jul 17, 2018
6d0a76c
[UPD] Update web_timeline.pot
oca-travis Jul 27, 2018
5a22919
[ADD] field_utils to web_timeline
tarteo Jul 27, 2018
89c8f04
[UPD] Update web_timeline.pot
oca-travis Jul 30, 2018
57a8ef2
[ADD] web_timeline: New dependency_arrow attribute
tarteo Aug 17, 2018
03ba678
[UPD] Update web_timeline.pot
oca-travis Aug 22, 2018
3a570bf
[ADD] Enable multiselect
tarteo Aug 24, 2018
c1f058c
[UPD] Update web_timeline.pot
oca-travis Oct 2, 2018
af55e75
[MIG] web_timeline: Migration to 12.0
tarteo Oct 23, 2018
0dda610
[IMP] Readme: Available attribute list
tarteo Oct 31, 2018
9880529
[UPD] README.rst
OCA-git-bot Nov 16, 2018
17deedf
[UPD] Update web_timeline.pot
oca-travis Nov 16, 2018
929b4a8
[UPD] Roadmap
tarteo Dec 5, 2018
5ebf9c0
[UPD] README.rst
OCA-git-bot Dec 5, 2018
63a9730
Update translation files
oca-transbot Dec 9, 2018
bce4def
[IMP] Add stack support
Dec 18, 2018
bcd9835
[UPD] README.rst
OCA-git-bot Dec 20, 2018
a72a79e
[FIX] web_timeline: fix readme - To be squashed with previous one on …
Dec 21, 2018
624bb50
[UPD] README.rst
OCA-git-bot Dec 21, 2018
ab0d5a6
[web_timeline][IMP] Add margin support in web_timeline (#1135)
cvinh Jan 8, 2019
7381bb9
[UPD] README.rst
OCA-git-bot Jan 8, 2019
fcbcd91
[FIX] web_timeline: Reloading view
tarteo Jan 16, 2019
78df273
[UPD] Update web_timeline.pot
oca-travis Jan 18, 2019
969edd1
Update translation files
oca-transbot Jan 27, 2019
0c46b93
[UPD] Update web_timeline.pot
oca-travis Apr 8, 2019
d97d9eb
Update translation files
oca-transbot May 20, 2019
99015dd
[12.0][FIX]web_timeline: fix group orders
denislour Jun 28, 2019
f16b002
web_timeline 12.0.1.0.4
OCA-git-bot Jun 28, 2019
97ad127
[12.0][web_timeline] Fix bug from group_order: locale instead locate.
denislour Jul 1, 2019
c3110f0
web_timeline 12.0.1.0.5
OCA-git-bot Jul 1, 2019
5ae6801
[FIX][12.0] web_timeline: Scroll Issue.
hpatelserpentcs Jul 10, 2019
93bcd5f
[UPD] Update web_timeline.pot
oca-travis Jul 10, 2019
66fb044
[UPD] README.rst
OCA-git-bot Jul 10, 2019
1d33b78
Update translation files
oca-transbot Jul 20, 2019
ace69c4
Revert "Merge PR #1330 into 12.0"
pedrobaeza Jul 22, 2019
5c2b915
Update translation files
oca-transbot Jul 27, 2019
1e1c97b
[UPD] README.rst
OCA-git-bot Jul 29, 2019
8c21bb2
Translated using Weblate (French)
Aug 6, 2019
4007276
Added translation using Weblate (Portuguese)
pedrocs-exo Aug 12, 2019
821169a
Translated using Weblate (Portuguese)
pedrocs-exo Aug 12, 2019
468394e
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
149778e
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
7bbaedc
Translated using Weblate (Croatian)
badbole Nov 14, 2019
c8892c1
[IMP] web_timeline: black, isort
thoongnv Dec 30, 2019
cc35a0b
[MIG] web_timeline: Migration to 13.0
thoongnv Dec 30, 2019
f9110fc
[REF] web_timeline: Refactor source code
thoongnv Dec 31, 2019
8e5b075
[REF] web_timeline: Refactor source code
thoongnv Feb 5, 2020
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
220 changes: 220 additions & 0 deletions web_timeline/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
============
Web timeline
============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-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/12.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-12-0/web-12-0-web_timeline
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot

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

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

The widget is based on the external library
http://visjs.org/timeline_examples.html

**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.
* ``field_utils``: used to format and parse values (see available functions in ``web.field_utils``).

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

Example:

.. code-block:: 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_start"
date_stop="date_end"
string="Tasks"
default_group_by="user_id"
event_open_popup="true"
zoomKey="ctrlKey"
colors="#ec7063:user_id == false;#2ecb71:kanban_state=='done';"
dependency_arrow="task_dependency_ids">
<field name="user_id"/>
<templates>
<div t-name="timeline-item">
<div t-esc="record.display_name"/>
Assigned to:
<span t-esc="record.user_id[1]"/>
</div>
</templates>
</timeline>
</field>
</record>

<record id="project.action_view_task" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,calendar,gantt,timeline,graph</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;
* Make action attributes work (create, edit, delete) like in form and tree views.

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_timeline%0Aversion:%2012.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>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Leonardo Donelli <donelli@webmonks.it>
* Adrien Didenot <adrien.didenot@horanet.com>
* Dennis Sluijk <d.sluijk@onestein.nl>
* Thong Nguyen Van <thongnv@trobz.com>

Other credits
~~~~~~~~~~~~~

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

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.

.. |maintainer-tarteo| image:: https://github.com/tarteo.png?size=40px
:target: https://github.com/tarteo
:alt: tarteo

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-tarteo|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.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
24 changes: 24 additions & 0 deletions web_timeline/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# 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": "13.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"],
"qweb": ["static/src/xml/web_timeline.xml"],
"data": ["views/web_timeline.xml"],
"maintainers": ["tarteo"],
"application": False,
"installable": True,
}
Loading