Skip to content

Commit

Permalink
[ADD] project_forecast_line_milestone
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsirintanis committed Feb 8, 2024
1 parent b2438cc commit a3356fb
Show file tree
Hide file tree
Showing 11 changed files with 559 additions and 0 deletions.
81 changes: 81 additions & 0 deletions project_forecast_line_milestone/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
===============================
Project Forecast Line Milestone
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d44b5101406aa1afce6fe550e3fd82d5c083b6bb7f45a49c05c1f5f8b7559465
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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/14.0/project_forecast_line_milestone
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_forecast_line_milestone
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=14.0
:alt: Try me on Runboat

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

This module recomputes forecast line end dates based on milestone target date of connected projects

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_forecast_line_milestone%0Aversion:%2014.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
~~~~~~~

* Therp BV

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

* Nikos Tsirintanis <[email protected]>

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/14.0/project_forecast_line_milestone>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions project_forecast_line_milestone/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions project_forecast_line_milestone/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Therp BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Project Forecast Line Milestone",
"summary": "Project Forecast Line dates according to Milestone target date",
"version": "14.0.1.0.0",
"author": "Therp BV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Project",
"website": "https://github.com/OCA/project",
"depends": ["project_forecast_line_priority", "project_milestone"],
"installable": True,
"development_status": "Alpha",
}
1 change: 1 addition & 0 deletions project_forecast_line_milestone/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
26 changes: 26 additions & 0 deletions project_forecast_line_milestone/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Therp BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models


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

@api.depends("date_deadline", "milestone_id", "milestone_id.target_date")
def _compute_forecast_date_planned_end(self):
"""Override method to use milestone_id.target_date"""
for this in self:
if this.milestone_id.target_date:
this.forecast_date_planned_end = this.milestone_id.target_date
continue
if this.date_deadline:
this.forecast_date_planned_end = this.date_deadline
continue
this.forecast_date_planned_end = this.forecast_date_planned_end

def _get_forecast_date_planned(self, priority=None):
"""Do not set forecast end if there exists a milestone date"""
self.ensure_one()
if self.milestone_id.target_date:
return False
return super()._get_forecast_date_planned(priority=priority)
1 change: 1 addition & 0 deletions project_forecast_line_milestone/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Nikos Tsirintanis <[email protected]>
1 change: 1 addition & 0 deletions project_forecast_line_milestone/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module recomputes forecast line end dates based on milestone target date of connected projects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a3356fb

Please sign in to comment.