Skip to content

Commit

Permalink
[IMP]project_timeline mproved timeline handling for project tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjosesegui-tecnativa committed Sep 6, 2024
1 parent 4ae0a16 commit 13e5007
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
1 change: 1 addition & 0 deletions project_timeline/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Contributors
* Pedro M. Baeza
* Carlos Dauden
* Alexandre Díaz
* Juan José Seguí

* `Open Source Integrators <https://www.opensourceintegrators.com>`_:

Expand Down
1 change: 0 additions & 1 deletion project_timeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from .hooks import populate_date_start
from . import models
2 changes: 1 addition & 1 deletion project_timeline/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Project timeline",
"summary": "Timeline view for projects",
"version": "14.0.1.5.0",
"version": "14.0.1.5.1",
"category": "Project Management",
"website": "https://github.com/OCA/project",
"author": "Tecnativa, Onestein, Odoo Community Association (OCA)",
Expand Down
16 changes: 0 additions & 16 deletions project_timeline/hooks.py

This file was deleted.

16 changes: 16 additions & 0 deletions project_timeline/migrations/14.0.1.5.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Tecnativa - Juan José Seguí
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr,
"""UPDATE project_task
SET planned_date_start = COALESCE(planned_date_start, date_assign, date_start),
planned_date_end = COALESCE(planned_date_end, date_end)
WHERE planned_date_start IS NULL AND planned_date_end IS NULL;
""",
)
8 changes: 2 additions & 6 deletions project_timeline/models/project_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@
class ProjectTask(models.Model):
_inherit = "project.task"

date_start = fields.Datetime("Start Date")

def update_date_end(self, stage_id):
res = super().update_date_end(stage_id)
res.pop("date_end", None)
return res
planned_date_start = fields.Datetime("Start Date")
planned_date_end = fields.Datetime("End Date")
1 change: 1 addition & 0 deletions project_timeline/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Pedro M. Baeza
* Carlos Dauden
* Alexandre Díaz
* Juan José Seguí

* `Open Source Integrators <https://www.opensourceintegrators.com>`_:

Expand Down
13 changes: 8 additions & 5 deletions project_timeline/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -423,6 +423,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Pedro M. Baeza</li>
<li>Carlos Dauden</li>
<li>Alexandre Díaz</li>
<li>Juan José Seguí</li>
</ul>
</li>
<li><a class="reference external" href="https://www.opensourceintegrators.com">Open Source Integrators</a>:<ul>
Expand All @@ -434,7 +435,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
12 changes: 6 additions & 6 deletions project_timeline/views/project_task_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline
date_start="date_start"
date_stop="date_end"
date_start="planned_date_start"
date_stop="planned_date_end"
default_group_by="project_id"
event_open_popup="true"
colors="white: user_id == false; #2ecb71: kanban_state == 'done'; #ec7063: kanban_state == 'blocked'"
Expand Down Expand Up @@ -59,8 +59,8 @@
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline
date_start="date_assign"
date_stop="date_end"
date_start="planned_date_start"
date_stop="planned_date_end"
default_group_by="project_id"
event_open_popup="true"
/>
Expand Down Expand Up @@ -111,8 +111,8 @@
<field name="inherit_id" ref="project.view_task_form2" />
<field name="arch" type="xml">
<xpath expr="//field[@name='date_assign']" position="after">
<field name="date_start" />
<field name="date_end" />
<field name="planned_date_start" />
<field name="planned_date_end" />
</xpath>
</field>
</record>
Expand Down

0 comments on commit 13e5007

Please sign in to comment.