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

11.0 mig web_timeline #912

Merged
merged 18 commits into from
Apr 23, 2018
Merged

11.0 mig web_timeline #912

merged 18 commits into from
Apr 23, 2018

Conversation

Maartincm
Copy link
Contributor

Migration of the Module web_timeline from V10 to V11.

I'm not a JS developer so any suggestion is more than welcome.

In the Issue #739 @pedrobaeza recommended the use of a new JS Library for this module. I'm working on that rigth now. Anyway, this version of the module is working on my end and uses the same lib that was used in V10.

P.D: I'm also uploading a PR for the module project/project_timeline

lmignon and others added 17 commits April 13, 2018 14:37
* 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
* [FIX] Correct write when grouped by

* Remove blank lines

* Minor changes
* Update the vis.js framework to latest stable version (v4.20.1) to add new functionality and save almost
400ko of source code in odoo assets (the vis dev team has isolate the code for timeline widget from the
 rest of their widgets)

* Add the possibility to display events with no duration (instantaneous) as the same time has regular events

* Add the possibility to choose between two scroll mode :
  -  zoom in time resolution (default)
  or
  -  vertical scroll (web browser default behaviour)

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
…same as base Calendar view)

In Odoo calendar view, the attribute date_delay is an alternative to date_stop, to provides the duration of the event instead of its end date.
This commit integrate this attribute to the Timeline view, but contrary to the base Calendar view the Timeline view could use both arguments (date_stop and date_delay) simultaneously.

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
The default window display all the events (aka 'fit'), in case of events spread over the year, the events are invisibles (too small to be readable)

Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
Change the attribute 'default_window' to 'mode' like the Odoo calendar view (to be iso functional)
CSS classes have changed with the updated version of vis.js
* Update Version in Manifest
* Remove enconding in .py files
* Rewrite the view definition according to version 11
@Maartincm
Copy link
Contributor Author

Let's see if It's okay this time @pedrobaeza

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

👍 Thank you!

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Tried on OCA/project#376 and working flawlessly, thanks!

@phatnguyenuit
Copy link
Member

Thank for your migration!
I tried and had a problem when I clicked on a group in timeline view.

image

@Maartincm
Copy link
Contributor Author

Yep, I completely forgot about that functionality. I'll fix that in a moment.

@pedrobaeza
Copy link
Member

@phatnguyenuit can you recheck with the done changes if all is OK now?

@phatnguyenuit
Copy link
Member

Hello @Maartincm!
I checked your new changes. It works!
Thank you!

@phatnguyenuit
Copy link
Member

Hello @pedrobaeza!
I checked it and now it's OK!

@pedrobaeza
Copy link
Member

Please give your explicit approval then with the GitHub tools.

Copy link
Member

@phatnguyenuit phatnguyenuit left a comment

Choose a reason for hiding this comment

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

Thank you!!

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

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

Thanks!

@pedrobaeza pedrobaeza merged commit d9bd5d8 into OCA:11.0 Apr 23, 2018
@metalmonkey69
Copy link

metalmonkey69 commented May 24, 2018

I tried to use this module for the project task by using the example given in https://github.com/OCA/web/tree/11.0/web_timeline:

  1. Created the file web_timeline/views/project_timeline.xml and added it into the manifest file.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_task_timeline" model="ir.ui.view">
        <field name="name">project.task.timeline</field>
        <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';" />
        </field>
    </record>

    <record id="project.action_view_task" model="ir.actions.act_window">
        <field name="name">Task</field>
        <field name="res_model">project.task</field>
        <field name="view_type">kanban</field>    
        <field name="view_mode">kanban,tree,form,calendar,timeline,graph</field>
    </record>
</odoo>
  1. Did an upgrade and got the following error:
:
  File "/opt/odoo11/odootest/odoo-11.0.post20180522/odoo/models.py", line 1040, in _validate_fields
    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint

Model not found: project.task

Error context:
View `project.task.timeline`
[view_id: 1339, xml_id: n/a, model: project.task, parent_id: n/a]
None" while parsing /opt/odoo11/odootest/odoo/odoo/addons/web_timeline/views/project_timeline.xml:3, near
<record id="view_task_timeline" model="ir.ui.view">
        <field name="name">project.task.timeline</field>
        <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';"/>
        </field>
    </record>
2018-05-24 18:35:52,262 10079 DEBUG odoo11_test odoo.service.server: cron0 started!
:

I did install the Project module and i can confirm the table project_task is in the database. I tried the runbot but i also did not see the Timeline icon appearing amongst the kanban, list, graph icons in the default kanban view.

What did i miss ?

@pedrobaeza
Copy link
Member

Please use https://github.com/OCA/project/tree/11.0/project_timeline

@metalmonkey69
Copy link

Thanks a lot !!

@metalmonkey69
Copy link

Just curious, what is the empty top row for ?
image

@pedrobaeza
Copy link
Member

No idea

@Maartincm
Copy link
Contributor Author

Imagine the next example in project.project model:
You want to group by a field like Assigned To and some of the records aren't assigned to anyone (as It's not required), then those records should appear in the first line.
Also You can drag a record to that line and the field you are groupying by will be modified to False.
Cheers

@metalmonkey69
Copy link

Noted. Thanks.

@karlis-dreizis
Copy link

@Maartincm
First of all I'd like to thank you for the work. This module opens quite a bit of important functionality for a lot people.

I've noticed some bugs. If you ctrl+click to create a new record (project_timeline project.task) after you press Save & Exit the new item time slice does not disappear until you navigate to a different menu item and you reload the view, nor does the newly created records start and end dates reflect the time slice selected in the gantt view. There are other ways it could be improved.

I fray from creating a new issue, because you mentioned your intent to swap out the gantt chart itself?.
If so do you mind sharing any the progress? Maybe you found an alternative library or its still (https://frappe.io/gantt)? Or you might have a rough ETA?

Thanks, again!

@Maartincm
Copy link
Contributor Author

Hey @InfernalLV, gratz for your comment.
Rigth now I'm really overwhelmed by work and study, which is holding me back from doing anything in this matter. So the ETA is pretty far away.
Being this the case, feel free to open an issue. I think the bugs you mention are not related with the JS Lib used to draw the Timeline and those could be fixed before moving to another library.
Greets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.