Skip to content

Commit

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

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:26f677048223493c18fbcc6bbe89ce38b00d40bb8ba9a4ef1f05af5cd98fb728
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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.

.. |maintainer-ntsirintanis| image:: https://github.com/ntsirintanis.png?size=40px
:target: https://github.com/ntsirintanis
:alt: ntsirintanis

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ntsirintanis|

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
15 changes: 15 additions & 0 deletions project_forecast_line_milestone/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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)",
"maintainers": ["ntsirintanis"],
"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
31 changes: 31 additions & 0 deletions project_forecast_line_milestone/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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"

def _forecast_date_planned_end_depends_list(self):
"""Returns a list of fields to trigger recomputation"""
return super()._forecast_date_planned_end_depends_list() + [
"milestone_id",
"milestone_id.target_date",
]

@api.depends(_forecast_date_planned_end_depends_list)
def _compute_forecast_date_planned_end(self):
"""Override method to use milestone_id.target_date"""
res = super()._compute_forecast_date_planned_end()
for this in self:
if not this.milestone_id.target_date:
continue
this.forecast_date_planned_end = this.milestone_id.target_date
return res

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 8f9f958

Please sign in to comment.