You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
5.2 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. =============
  5. Timeline view
  6. =============
  7. Define a new view displaying events in an interactive visualization chart.
  8. The widget is based on the external library
  9. http://visjs.org/timeline_examples.html
  10. Configuration
  11. =============
  12. You need to define a view with the tag <timeline> as base element. These are
  13. the possible attributes for the tag:
  14. * date_start (required): it defines the name of the field of type date that
  15. contains the start of the event.
  16. * date_end (optional): it defines the name of the field of type date that
  17. contains the end of the event.
  18. * date_delay (optional): it defines the name of the field of type date that
  19. contains the end of the event.
  20. * default_group_by (required): it defines the name of the field that will be
  21. taken as default group by when accessing the view or when no other group by
  22. is selected.
  23. * event_open_popup (optional): when set to true, it allows to edit the events
  24. in a popup. If not (default value), the record is edited changing to form
  25. view.
  26. * colors (optional): it allows to set certain specific colors if the expressed
  27. condition (JS syntax) is met.
  28. You also need to declare the view in an action window of the involved model.
  29. Example:
  30. .. code-block:: xml
  31. <?xml version="1.0" encoding="utf-8"?>
  32. <odoo>
  33. <record id="view_task_timeline" model="ir.ui.view">
  34. <field name="model">project.task</field>
  35. <field name="type">timeline</field>
  36. <field name="arch" type="xml">
  37. <timeline date_start="date_start"
  38. date_stop="date_end"
  39. string="Tasks"
  40. default_group_by="user_id"
  41. event_open_popup="true"
  42. colors="#ec7063:user_id == false;#2ecb71:kanban_state=='done';">
  43. </timeline>
  44. </field>
  45. </record>
  46. <record id="project.action_view_task" model="ir.actions.act_window">
  47. <field name="view_mode">kanban,tree,form,calendar,gantt,timeline,graph</field>
  48. </record>
  49. </odoo>
  50. Usage
  51. =====
  52. For accessing the timeline view, you have to click on the button with the clock
  53. icon in the view switcher. The first time you access to it, the timeline window
  54. is zoomed to fit all the current elements, the same as when you perform a
  55. search, filter or group by operation.
  56. You can use the mouse scroll to zoom in or out in the timeline, and click on
  57. any free area and drag for panning the view in that direction.
  58. The records of your model will be shown as rectangles whose widths are the
  59. duration of the event according our definition. You can select them clicking
  60. on this rectangle. You can also use Ctrl or Shift keys for adding discrete
  61. or range selections. Selected records are hightlighted with a different color
  62. (but the difference will be more noticeable depending on the background color).
  63. Once selected, you can drag and move the selected records across the timeline.
  64. When a record is selected, a red cross button appears on the upper left corner
  65. that allows to remove that record. This doesn't work for multiple records
  66. although they were selected.
  67. Records are grouped in different blocks depending on the group by criteria
  68. selected (if none is specified, then the default group by is applied).
  69. Dragging a record from one block to another change the corresponding field to
  70. the value that represents the block. You can also click on the group name to
  71. edit the involved record directly.
  72. Double-click on the record to edit it. Double-click in open area to create a
  73. new record with the group and start date linked to the area you clicked in.
  74. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  75. :alt: Try me on Runbot
  76. :target: https://runbot.odoo-community.org/runbot/162/8.0
  77. Known issues / Roadmap
  78. ======================
  79. * Implement support for vis.js timeline range item addition (with Ctrl key
  80. pressed).
  81. * Implement a more efficient way of refreshing timeline after a record update.
  82. Bug Tracker
  83. ===========
  84. Bugs are tracked on `GitHub Issues
  85. <https://github.com/OCA/web/issues>`_. In case of trouble, please
  86. check there if your issue has already been reported. If you spotted it first,
  87. help us smashing it by providing a detailed and welcomed feedback.
  88. Credits
  89. =======
  90. Images
  91. ------
  92. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  93. Contributors
  94. ------------
  95. * Laurent Mignon <laurent.mignon@acsone.eu>
  96. * Adrien Peiffer <adrien.peiffer@acsone.eu>
  97. * Pedro M. Baeza <pedro.baeza@tecnativa.com>
  98. * Leonardo Donelli <donelli@webmonks.it>
  99. Maintainer
  100. ----------
  101. .. image:: https://odoo-community.org/logo.png
  102. :alt: Odoo Community Association
  103. :target: https://odoo-community.org
  104. This module is maintained by the OCA.
  105. 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.
  106. To contribute to this module, please visit https://odoo-community.org.