Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 81 additions & 0 deletions project_task_schedule/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
=====================
Project Task Schedule
=====================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/13.0/project_task_schedule
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_task_schedule
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/140/13.0
:alt: Try me on Runbot

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

This module adds start and end date to tasks for planning.

**Table of contents**

.. contents::
:local:

Usage
=====

* Go to **Project > Enable Task Planning**.
* Go to Project Tasks, and you will be required to enter start_date and end_date.


Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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/project/issues/new?body=module:%20project_task_schedule%0Aversion:%2013.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
~~~~~~~

* Sunflower IT

Contributors
~~~~~~~~~~~~

* Dan Kiplangat <dan@sunflowerweb.nl>
* Tom Blauwendraat <tom@sunflowerweb.nl>

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.

This module is part of the `OCA/project <https://github.com/OCA/project/tree/13.0>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions project_task_schedule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions project_task_schedule/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 Sunflower IT <https://sunflowerweb.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Project Task Schedule",
"version": "13.0.1.0.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

13.0.1.0.0


Internal review first, but this looks nice, I think we can directly propose it to OCA and ping Pedro; in https://github.com/OCA/project/issues/768 he is proposing to add the fields to project_timeline instead of a new module.

"category": "Project",
"author": "Sunflower IT, " "Odoo Community Association (OCA)",
Copy link
Member Author

Choose a reason for hiding this comment

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

This has some weird apostrophe flavour, did you run pre-commit run -a? pre-commit

"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"depends": ["project", "date_range"],
"data": [
"views/project_project_views.xml",
"views/project_task_views.xml",
],
"installable": True,
}
4 changes: 4 additions & 0 deletions project_task_schedule/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import project_project
from . import project_task
9 changes: 9 additions & 0 deletions project_task_schedule/models/project_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ProjectProject(models.Model):
_inherit = "project.project"

enable_task_planning = fields.Boolean("Enable Task Planning?")
Copy link
Member Author

Choose a reason for hiding this comment

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

date_planned_required may be better, with a help text of 'When this is enabled, tasks on this project require a start and end date'

25 changes: 25 additions & 0 deletions project_task_schedule/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models, api


class ProjectTask(models.Model):
_inherit = "project.task"

enable_task_planning = fields.Boolean(
related='project_id.enable_task_planning')
date_range_id = fields.Many2one(
comodel_name="date.range", string="Date range")
start_date = fields.Date("Start Date")
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this needs a default of today, as well as end date, so that there is always a value in it after it's created for example on timeline

end_date = fields.Date("End Date")
Copy link
Member Author

Choose a reason for hiding this comment

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

If it is two new fields, I like date_planned_start and date_planned_end, mirroring Enterprise; if we use existing fields, I think date_end is still there and we can reimplement date_start which was removed in 13.0. Let's see what Pedro replies on my question

Copy link
Member Author

@thomaspaulb thomaspaulb Dec 3, 2020

Choose a reason for hiding this comment

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

He answered date_start and date_end, so let's reimplement date_start and add a default to date_end, and then propose it to him and see what he says


_sql_constraints = [
('start_end_date_check',
"CHECK ((start_date <= end_date))",
"The start date must be prior to the end date."),
]

@api.onchange("date_range_id")
def onchange_date_range_id(self):
self.start_date = self.date_range_id.date_start
self.end_date = self.date_range_id.date_end
2 changes: 2 additions & 0 deletions project_task_schedule/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Dan Kiplangat <dan@sunflowerweb.nl>
* Tom Blauwendraat <tom@sunflowerweb.nl>
1 change: 1 addition & 0 deletions project_task_schedule/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds start and end date to tasks for planning.
3 changes: 3 additions & 0 deletions project_task_schedule/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Go to **Project > Enable Task Planning**.
* Go to Project Tasks, and you will be required to enter start_date and end_date.

Binary file added project_task_schedule/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading