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
91 changes: 91 additions & 0 deletions project_task_parent_completion_blocking/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 completion blocking
=======================================

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

.. |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_completion_blocking
: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_completion_blocking
: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|

Prevents a task from being completed if a child task isn't completed.

**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_completion_blocking%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

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_completion_blocking>`_ 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_completion_blocking/__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_completion_blocking/__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 completion blocking",
"version": "19.0.1.0.0",
"category": "Project Management",
"summary": "Prevents a task from being completed if any children task isn't.",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["david-banon-tecnativa"],
"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"installable": True,
"depends": ["project"],
}
27 changes: 27 additions & 0 deletions project_task_parent_completion_blocking/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_completion_blocking
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.6\n"

#. module: project_task_parent_completion_blocking
#: model:ir.model,name:project_task_parent_completion_blocking.model_project_task
msgid "Task"
msgstr "Tarea"

#. module: project_task_parent_completion_blocking
#. odoo-python
#: code:addons/project_task_parent_completion_blocking/models/project_task.py
msgid "You can't close this task because it has open subtasks."
msgstr "No puede cerrar esta tarea porque tiene subtareas abiertas."
28 changes: 28 additions & 0 deletions project_task_parent_completion_blocking/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_completion_blocking
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-05-05 14:57+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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_completion_blocking
#: model:ir.model,name:project_task_parent_completion_blocking.model_project_task
msgid "Task"
msgstr "Lavoro"

#. module: project_task_parent_completion_blocking
#. odoo-python
#: code:addons/project_task_parent_completion_blocking/models/project_task.py
msgid "You can't close this task because it has open subtasks."
msgstr "Non si può chiudere il lavoro perché ha dei sotto lavori aperti."
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_completion_blocking
#
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_completion_blocking
#: model:ir.model,name:project_task_parent_completion_blocking.model_project_task
msgid "Task"
msgstr ""

#. module: project_task_parent_completion_blocking
#. odoo-python
#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0
msgid "You can't close this task because it has open subtasks."
msgstr ""
26 changes: 26 additions & 0 deletions project_task_parent_completion_blocking/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_completion_blocking
#
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_completion_blocking
#: model:ir.model,name:project_task_parent_completion_blocking.model_project_task
msgid "Task"
msgstr ""

#. module: project_task_parent_completion_blocking
#. odoo-python
#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0
msgid "You can't close this task because it has open subtasks."
msgstr ""
29 changes: 29 additions & 0 deletions project_task_parent_completion_blocking/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_parent_completion_blocking
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-06-30 04:14+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@luxim.si>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: project_task_parent_completion_blocking
#: model:ir.model,name:project_task_parent_completion_blocking.model_project_task
msgid "Task"
msgstr "Opravilo"

#. module: project_task_parent_completion_blocking
#. odoo-python
#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0
msgid "You can't close this task because it has open subtasks."
msgstr "Tega opravila ne morete zapreti, ker ima odprta podrejena opravila."
1 change: 1 addition & 0 deletions project_task_parent_completion_blocking/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
18 changes: 18 additions & 0 deletions project_task_parent_completion_blocking/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import api, models
from odoo.exceptions import ValidationError


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

@api.constrains("stage_id")
def _check_subtasks_done_before_closing(self):
for task in self:
if task.stage_id.fold and task.child_ids.filtered(
lambda t: not t.stage_id.fold
):
raise ValidationError(
self.env._(
"You can't close this task because it has open subtasks."
)
)
3 changes: 3 additions & 0 deletions project_task_parent_completion_blocking/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com):
- Pedro M. Baeza
- David Bañón
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevents a task from being completed if a child task isn't completed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading