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

[9.0] [MIG] web_timeline #393

Merged
merged 5 commits into from
May 22, 2017
Merged

[9.0] [MIG] web_timeline #393

merged 5 commits into from
May 22, 2017

Conversation

pedrobaeza
Copy link
Member

Timeline view

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

Configuration

You need to define a view with the tag 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
    view.
  • 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.

Example:

<?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"
                      colors="#ec7063:user_id == false;#2ecb71:kanban_state=='done';">
            </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 it or out in the timeline, and make 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.

Making double click on the selected record, you would be able to edit it.
Making double click on a free area, you will create a record taking the group
and the start date where you click as initial data.

Known issues / Roadmap

  • Implement support for vis.js timeline range item addition (with Ctrl key
    pressed).
  • Implement a more efficient way of refreshing timeline after a record update.

@pedrobaeza
Copy link
Member Author

cc @Tecnativa

@pedrobaeza pedrobaeza changed the title 9.0 web timeline [9.0] [MIG] web_timeline Aug 1, 2016
@pedrobaeza
Copy link
Member Author

You can try the module in this PR with a practical example in projects: OCA/project#187

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 it or out in the timeline, and make click
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/it/in

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't "make click on", you just "click on"

@pedrobaeza
Copy link
Member Author

pedrobaeza commented Aug 2, 2016

Comments fixed, but I'm working on some other things:

  • Image of the assigned person
  • Other fields rendering (maybe Qweb template)

@yajo
Copy link
Member

yajo commented Aug 3, 2016

This is a great module! Hoping to see it finished 😉

@funbaker
Copy link

@pedrobaeza Do you plan to implement the Critical Path Method?

@pedrobaeza
Copy link
Member Author

Not for now, so you can work on that if you want.

@pedrobaeza pedrobaeza added this to the 9.0 milestone Sep 14, 2016
@rafaelbn
Copy link
Member

@pedrobaeza this PR is working fine, maybe is better to merge and the rest add it in known issues?

@yajo
Copy link
Member

yajo commented Dec 16, 2016

Is this still WIP?

@rafaelbn
Copy link
Member

@yajo still pending #393 (comment) (nice to have)

@LeartS LeartS mentioned this pull request Jan 12, 2017
@lasley
Copy link
Contributor

lasley commented Jan 21, 2017

Maybe we should just add #393 (comment) to Roadmap & review/merge the existing?

@pedrobaeza
Copy link
Member Author

Yes, I think this is enough for a first version indeed, although I would like to add the other thing.

Copy link
Sponsor Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The history from #521 is not preserved!
see #306 (comment)

lmignon and others added 5 commits May 20, 2017 14:57
* 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
@pedrobaeza
Copy link
Member Author

@lmignon @adrienpeiffer I have fixed commit history to reflect correctly the dates. Please give your final blessing for merging this.

@pedrobaeza
Copy link
Member Author

Travis is failing due to web_widget_float_formula

@pedrobaeza
Copy link
Member Author

Merging this finally! Thanks to all.

@pedrobaeza pedrobaeza merged commit 1a7250c into OCA:9.0 May 22, 2017
@pedrobaeza pedrobaeza deleted the 9.0-web_timeline branch May 22, 2017 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants