diff --git a/project_forecast_line_milestone/README.rst b/project_forecast_line_milestone/README.rst new file mode 100644 index 0000000000..08f31ad251 --- /dev/null +++ b/project_forecast_line_milestone/README.rst @@ -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 `_ + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Nikos Tsirintanis + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_forecast_line_milestone/__init__.py b/project_forecast_line_milestone/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/project_forecast_line_milestone/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_forecast_line_milestone/__manifest__.py b/project_forecast_line_milestone/__manifest__.py new file mode 100644 index 0000000000..fab2af9bec --- /dev/null +++ b/project_forecast_line_milestone/__manifest__.py @@ -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", +} diff --git a/project_forecast_line_milestone/models/__init__.py b/project_forecast_line_milestone/models/__init__.py new file mode 100644 index 0000000000..edf2d36b9c --- /dev/null +++ b/project_forecast_line_milestone/models/__init__.py @@ -0,0 +1 @@ +from . import project_task diff --git a/project_forecast_line_milestone/models/project_task.py b/project_forecast_line_milestone/models/project_task.py new file mode 100644 index 0000000000..b6a1454307 --- /dev/null +++ b/project_forecast_line_milestone/models/project_task.py @@ -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) diff --git a/project_forecast_line_milestone/readme/CONTRIBUTORS.rst b/project_forecast_line_milestone/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..f27151686c --- /dev/null +++ b/project_forecast_line_milestone/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Nikos Tsirintanis diff --git a/project_forecast_line_milestone/readme/DESCRIPTION.rst b/project_forecast_line_milestone/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..6a24e1d85d --- /dev/null +++ b/project_forecast_line_milestone/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module recomputes forecast line end dates based on milestone target date of connected projects diff --git a/project_forecast_line_milestone/static/description/icon.png b/project_forecast_line_milestone/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/project_forecast_line_milestone/static/description/icon.png differ diff --git a/project_forecast_line_milestone/static/description/index.html b/project_forecast_line_milestone/static/description/index.html new file mode 100644 index 0000000000..309826f042 --- /dev/null +++ b/project_forecast_line_milestone/static/description/index.html @@ -0,0 +1,427 @@ + + + + + + +Project Forecast Line Milestone + + + +
+

Project Forecast Line Milestone

+ + +

Alpha License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

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

+
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/setup/project_forecast_line_milestone/odoo/addons/project_forecast_line_milestone b/setup/project_forecast_line_milestone/odoo/addons/project_forecast_line_milestone new file mode 120000 index 0000000000..27725a0b05 --- /dev/null +++ b/setup/project_forecast_line_milestone/odoo/addons/project_forecast_line_milestone @@ -0,0 +1 @@ +../../../../project_forecast_line_milestone \ No newline at end of file diff --git a/setup/project_forecast_line_milestone/setup.py b/setup/project_forecast_line_milestone/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/project_forecast_line_milestone/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)