Skip to content
Draft
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
91 changes: 91 additions & 0 deletions project_task_parent_due_auto/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================================
Project task parent due date auto
=================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d23d05d1bf1a558b87badb7e8d7fe2d0d315ce522602ae92f5e43411a9d0ee48
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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/19.0/project_task_parent_due_auto
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-19-0/project-19-0-project_task_parent_due_auto
: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=19.0
:alt: Try me on Runboat

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

Updates the parent task's due date when a child's due date is changed.

**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_task_parent_due_auto%0Aversion:%2019.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
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- David Bañón Gil

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-david-banon-tecnativa| image:: https://github.com/david-banon-tecnativa.png?size=40px
:target: https://github.com/david-banon-tecnativa
:alt: david-banon-tecnativa

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

|maintainer-david-banon-tecnativa|

This module is part of the `OCA/project <https://github.com/OCA/project/tree/19.0/project_task_parent_due_auto>`_ 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_task_parent_due_auto/__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_task_parent_due_auto/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 Tecnativa David Bañón
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
"name": "Project task parent due date auto",
"version": "19.0.1.0.0",
"category": "Project Management",
"summary": "Recalculates parent task's due date when child task changes",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["david-banon-tecnativa"],
"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"installable": True,
"depends": ["project"],
}
22 changes: 22 additions & 0 deletions project_task_parent_due_auto/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_due_auto
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-04-11 08:58+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: project_task_parent_due_auto
#: model:ir.model,name:project_task_parent_due_auto.model_project_task
msgid "Task"
msgstr "Lavoro"
19 changes: 19 additions & 0 deletions project_task_parent_due_auto/i18n/project_task_parent_due_auto.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_due_auto
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: project_task_parent_due_auto
#: model:ir.model,name:project_task_parent_due_auto.model_project_task
msgid "Task"
msgstr ""
20 changes: 20 additions & 0 deletions project_task_parent_due_auto/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_due_auto
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"

#. module: project_task_parent_due_auto
#: model:ir.model,name:project_task_parent_due_auto.model_project_task
msgid "Task"
msgstr ""
1 change: 1 addition & 0 deletions project_task_parent_due_auto/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
28 changes: 28 additions & 0 deletions project_task_parent_due_auto/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from odoo import api, models


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

@api.model_create_multi
def create(self, vals_list):
tasks = super().create(vals_list)
for vals, task in zip(vals_list, tasks, strict=False):
if "date_deadline" in vals:
task.update_parent_task_dates()
return tasks

def write(self, vals):
res = super().write(vals)
if "date_deadline" in vals:
self.update_parent_task_dates()
return res

def update_parent_task_dates(self):
for task in self:
parent = task.parent_id
if parent:
children = parent.child_ids.filtered("date_deadline")
deadline = children and min(children.mapped("date_deadline"))
if deadline and parent.date_deadline != deadline:
parent.date_deadline = deadline
3 changes: 3 additions & 0 deletions project_task_parent_due_auto/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions project_task_parent_due_auto/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Tecnativa](https://www.tecnativa.com):

> - Pedro M. Baeza
> - David Bañón Gil
1 change: 1 addition & 0 deletions project_task_parent_due_auto/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updates the parent task's due date when a child's due date is changed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading