From e6c4c2098ce88c1ba4f2582c2bab8188df4e1be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ba=C3=B1=C3=B3n?= Date: Thu, 10 Apr 2025 10:31:34 +0200 Subject: [PATCH 01/12] [ADD] project_task_parent_completion_blocking: parent can't be completed if all childs aren't completed. TT55846 --- .../README.rst | 87 ++++ .../__init__.py | 1 + .../__manifest__.py | 15 + .../i18n/es.po | 30 ++ ...roject_task_parent_completion_blocking.pot | 26 ++ .../models/__init__.py | 1 + .../models/project_task.py | 16 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 1 + .../static/description/icon.png | Bin 0 -> 10254 bytes .../static/description/index.html | 429 ++++++++++++++++++ .../tests/__init__.py | 1 + ...project_task_parent_completion_blocking.py | 66 +++ 13 files changed, 677 insertions(+) create mode 100644 project_task_parent_completion_blocking/README.rst create mode 100644 project_task_parent_completion_blocking/__init__.py create mode 100644 project_task_parent_completion_blocking/__manifest__.py create mode 100644 project_task_parent_completion_blocking/i18n/es.po create mode 100644 project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot create mode 100644 project_task_parent_completion_blocking/models/__init__.py create mode 100644 project_task_parent_completion_blocking/models/project_task.py create mode 100644 project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst create mode 100644 project_task_parent_completion_blocking/readme/DESCRIPTION.rst create mode 100644 project_task_parent_completion_blocking/static/description/icon.png create mode 100644 project_task_parent_completion_blocking/static/description/index.html create mode 100644 project_task_parent_completion_blocking/tests/__init__.py create mode 100644 project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py diff --git a/project_task_parent_completion_blocking/README.rst b/project_task_parent_completion_blocking/README.rst new file mode 100644 index 0000000000..e090453869 --- /dev/null +++ b/project_task_parent_completion_blocking/README.rst @@ -0,0 +1,87 @@ +======================================= +Project task parent completion blocking +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d3e2eadb57ab9a1d05c17ebc2d3950a473504aebc8d4a267af34707905547ac9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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/16.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-16-0/project-16-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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Prevents a parent task from beeing completed if a child task isn't completed. + +**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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * 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 `__: + +|maintainer-david-banon-tecnativa| + +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_task_parent_completion_blocking/__init__.py b/project_task_parent_completion_blocking/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/project_task_parent_completion_blocking/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_task_parent_completion_blocking/__manifest__.py b/project_task_parent_completion_blocking/__manifest__.py new file mode 100644 index 0000000000..1a67bb8e04 --- /dev/null +++ b/project_task_parent_completion_blocking/__manifest__.py @@ -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": "16.0.1.0.0", + "category": "Project Management", + "summary": "Prevents a parent 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"], +} diff --git a/project_task_parent_completion_blocking/i18n/es.po b/project_task_parent_completion_blocking/i18n/es.po new file mode 100644 index 0000000000..a622b4cd76 --- /dev/null +++ b/project_task_parent_completion_blocking/i18n/es.po @@ -0,0 +1,30 @@ +# 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" +"POT-Creation-Date: 2025-04-10 08:11+0000\n" +"PO-Revision-Date: 2025-04-10 10:15+0200\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:0 +#, python-format +msgid "You can't close this task because it has open subtasks." +msgstr "No puede cerrar esta tarea porque tiene subtareas abiertas." diff --git a/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot new file mode 100644 index 0000000000..287fd3fafd --- /dev/null +++ b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot @@ -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 16.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 +#, python-format +msgid "You can't close this task because it has open subtasks." +msgstr "" diff --git a/project_task_parent_completion_blocking/models/__init__.py b/project_task_parent_completion_blocking/models/__init__.py new file mode 100644 index 0000000000..edf2d36b9c --- /dev/null +++ b/project_task_parent_completion_blocking/models/__init__.py @@ -0,0 +1 @@ +from . import project_task diff --git a/project_task_parent_completion_blocking/models/project_task.py b/project_task_parent_completion_blocking/models/project_task.py new file mode 100644 index 0000000000..6f3a53be6e --- /dev/null +++ b/project_task_parent_completion_blocking/models/project_task.py @@ -0,0 +1,16 @@ +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( + _("You can't close this task because it has open subtasks.") + ) diff --git a/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst b/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..3f2cbd83cb --- /dev/null +++ b/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Pedro M. Baeza + * David Bañón diff --git a/project_task_parent_completion_blocking/readme/DESCRIPTION.rst b/project_task_parent_completion_blocking/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..dfead169a0 --- /dev/null +++ b/project_task_parent_completion_blocking/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Prevents a parent task from beeing completed if a child task isn't completed. diff --git a/project_task_parent_completion_blocking/static/description/icon.png b/project_task_parent_completion_blocking/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcc49c24f364e9adf0afbc6fc0bac6dbecdeb11 GIT binary patch literal 10254 zcmbt)WmufcvhH9Zc!C8B?l8#UE&&o;gF7=g3=D(IAOS+K1lK^25Zv7%L4sRw_uvvF z*qyAk?>c**=lnR&y+1yw{;I3Hy6Ua2{<d0kcR+VvBo; zA_X`>;1;xAPL9rQqFxd#f5{a^zW*uaW+r3+U{|fRunu`GZhy$X z8_|Zi{zd#vIokczl8Xh*4Wi@i0+C?Rg1AB5VOEg8B>buLFCi~r5DPd2ED7QP2>^LO zKpr7+?*I1bPaFSLLEa0l2$tj*;u8Qtc=&(RUc*VK@ zjIN{I--GfO@vl+&r^eqy_BZ3dndN_PDzMc*W^!?dIsWAWU@LBjBg6^f4F6*!-hUYh zY$Xb}gF8b0%S1Ac@c%Rs()UCiEu3v6SiFE>h_!{gBb-H2{e=wB5o!YkT0>#LKZFw$ z?CuD0Gvfsb(|XbVxx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ZTmB&mWMkZp7Kj7^kth#_uX z5z>gC(8Xz|Ie(+#&wiF3;Aey|Db(R*-U)!6;l_5@u?-$>j0SgEl5+c}Lfe-$p-dFH zB_$bC<)x6#A_2Uuo8=^l1@}vK!gvbF#b&MoH8ac3xMxUz$LFb8KU(x$YhtHanM_sw zYOFMBX2iNNSe&a}!;G9nv(tsW4@%3iQcqczOCF*JOBQ@4Orw=o?_vc(9$hfO`>U6& zyY_CUa9pASiJpmv`@oR!k;&$`h8!)$uS=}d-fPddfIdMDUW@%3y1LI(1Q=e$)sz(QC*E;Nfl99YTgk+|@jl`+iF?<_D?4YqV0Zl)lO8YWC@1ZWW^mi{5ePQN<~FQ2NMG$|K{py5akJa zkezmqhN)>MGMp$7=sOo2(7ppv``dCIwf&MaQQis7S596kkiw8Do(jO?EY4iJ4Hec6 z4Hymzu`w)cI9Pbq6GPtTP)x&Lmk;FT=ZCB4>(5}c0?;2l`p&?>&<;2(P8a3lOTNP# zdEzF5qDpkRR&PZC&cS{7xD@qV;(g5X%xI?m$9Q + + + + +Project task parent completion blocking + + + +
+

Project task parent completion blocking

+ + +

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

+

Prevents a parent task from beeing completed if a child task isn’t completed.

+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Pedro M. Baeza
    • +
    • David Bañón
    • +
    +
  • +
+
+
+

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.

+

Current maintainer:

+

david-banon-tecnativa

+

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_task_parent_completion_blocking/tests/__init__.py b/project_task_parent_completion_blocking/tests/__init__.py new file mode 100644 index 0000000000..3419270500 --- /dev/null +++ b/project_task_parent_completion_blocking/tests/__init__.py @@ -0,0 +1 @@ +from . import test_project_task_parent_completion_blocking diff --git a/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py b/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py new file mode 100644 index 0000000000..ff23f89f2c --- /dev/null +++ b/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py @@ -0,0 +1,66 @@ +from odoo.exceptions import ValidationError +from odoo.tests.common import TransactionCase + + +class TestParentChildBlock(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.test_project = ( + cls.env["project.project"] + .with_context(mail_create_nolog=True) + .create( + { + "name": "Test Project", + "privacy_visibility": "employees", + "alias_name": "project+test", + } + ) + ) + cls.parent_task = ( + cls.env["project.task"] + .with_context(mail_create_nolog=True) + .create({"name": "Pigs UserTask", "project_id": cls.test_project.id}) + ) + cls.child_task = ( + cls.env["project.task"] + .with_context(mail_create_nolog=True) + .create({"name": "Pigs ManagerTask", "project_id": cls.test_project.id}) + ) + + cls.stage_pending = cls.env["project.task.type"].create( + {"name": "a", "project_ids": [(4, cls.test_project.id)], "fold": False} + ) + cls.stage_done = cls.env["project.task.type"].create( + {"name": "b", "project_ids": [(4, cls.test_project.id)], "fold": True} + ) + cls.child_task.parent_id = cls.parent_task + cls.parent_task.stage_id = cls.stage_pending + cls.child_task.stage_id = cls.stage_pending + + def test_child_blocks_parent(self): + with self.assertRaises(ValidationError): + self.parent_task.stage_id = self.stage_done + extra_task = ( + self.env["project.task"] + .with_context(mail_create_nolog=True) + .create( + { + "name": "Test Task 3", + "project_id": self.test_project.id, + } + ) + ) + self.parent_task.child_ids += extra_task + extra_task.stage_id = self.stage_done + with self.assertRaises(ValidationError): + self.parent_task.stage_id = self.stage_done + + def test_child_not_blocks_parent(self): + self.child_task.stage_id = self.stage_done + self.parent_task.stage_id = self.stage_done + self.assertEqual( + self.parent_task.stage_id, + self.stage_done, + "Parent should be done if child is done", + ) From e075beea289e2a2865bc45c2c219e70f6c3dfde7 Mon Sep 17 00:00:00 2001 From: mymage Date: Fri, 11 Apr 2025 08:58:26 +0000 Subject: [PATCH 02/12] Added translation using Weblate (Italian) --- .../i18n/it.po | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 project_task_parent_completion_blocking/i18n/it.po diff --git a/project_task_parent_completion_blocking/i18n/it.po b/project_task_parent_completion_blocking/i18n/it.po new file mode 100644 index 0000000000..b3a741d69d --- /dev/null +++ b/project_task_parent_completion_blocking/i18n/it.po @@ -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: Automatically generated\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" + +#. 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 +#, python-format +msgid "You can't close this task because it has open subtasks." +msgstr "" From 7353b00714f79f809f8cd023e03c8fe81466913e Mon Sep 17 00:00:00 2001 From: david-banon-tecnativa Date: Wed, 30 Apr 2025 18:45:54 +0200 Subject: [PATCH 03/12] [IMP] project_task_parent_completion_blocking: pre-commit auto fixes TT56201 --- .../README.rst | 25 ++++++++++--------- .../__manifest__.py | 2 +- .../pyproject.toml | 3 +++ .../readme/CONTRIBUTORS.md | 3 +++ .../readme/CONTRIBUTORS.rst | 4 --- .../{DESCRIPTION.rst => DESCRIPTION.md} | 3 ++- .../static/description/index.html | 9 ++++--- 7 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 project_task_parent_completion_blocking/pyproject.toml create mode 100644 project_task_parent_completion_blocking/readme/CONTRIBUTORS.md delete mode 100644 project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst rename project_task_parent_completion_blocking/readme/{DESCRIPTION.rst => DESCRIPTION.md} (82%) diff --git a/project_task_parent_completion_blocking/README.rst b/project_task_parent_completion_blocking/README.rst index e090453869..191ba649e8 100644 --- a/project_task_parent_completion_blocking/README.rst +++ b/project_task_parent_completion_blocking/README.rst @@ -17,18 +17,19 @@ Project task parent completion blocking :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/16.0/project_task_parent_completion_blocking + :target: https://github.com/OCA/project/tree/18.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-16-0/project-16-0-project_task_parent_completion_blocking + :target: https://translation.odoo-community.org/projects/project-18-0/project-18-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=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -Prevents a parent task from beeing completed if a child task isn't completed. +Prevents a parent task from beeing completed if a child task isn't +completed. **Table of contents** @@ -41,7 +42,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -49,20 +50,20 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Pedro M. Baeza - * David Bañón + - Pedro M. Baeza + - David Bañón Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -82,6 +83,6 @@ Current `maintainer `__: |maintainer-david-banon-tecnativa| -This module is part of the `OCA/project `_ project on GitHub. +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_task_parent_completion_blocking/__manifest__.py b/project_task_parent_completion_blocking/__manifest__.py index 1a67bb8e04..4bc7f0648b 100644 --- a/project_task_parent_completion_blocking/__manifest__.py +++ b/project_task_parent_completion_blocking/__manifest__.py @@ -5,7 +5,7 @@ "name": "Project task parent completion blocking", "version": "16.0.1.0.0", "category": "Project Management", - "summary": "Prevents a parent task from being completed if any children task isn't.", + "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", diff --git a/project_task_parent_completion_blocking/pyproject.toml b/project_task_parent_completion_blocking/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/project_task_parent_completion_blocking/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/project_task_parent_completion_blocking/readme/CONTRIBUTORS.md b/project_task_parent_completion_blocking/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..2a04310db9 --- /dev/null +++ b/project_task_parent_completion_blocking/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - David Bañón diff --git a/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst b/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst deleted file mode 100644 index 3f2cbd83cb..0000000000 --- a/project_task_parent_completion_blocking/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* `Tecnativa `_: - - * Pedro M. Baeza - * David Bañón diff --git a/project_task_parent_completion_blocking/readme/DESCRIPTION.rst b/project_task_parent_completion_blocking/readme/DESCRIPTION.md similarity index 82% rename from project_task_parent_completion_blocking/readme/DESCRIPTION.rst rename to project_task_parent_completion_blocking/readme/DESCRIPTION.md index dfead169a0..bf843a4e45 100644 --- a/project_task_parent_completion_blocking/readme/DESCRIPTION.rst +++ b/project_task_parent_completion_blocking/readme/DESCRIPTION.md @@ -1 +1,2 @@ -Prevents a parent task from beeing completed if a child task isn't completed. +Prevents a parent task from beeing completed if a child task isn't +completed. diff --git a/project_task_parent_completion_blocking/static/description/index.html b/project_task_parent_completion_blocking/static/description/index.html index 7e185f5e6f..12069d8fd7 100644 --- a/project_task_parent_completion_blocking/static/description/index.html +++ b/project_task_parent_completion_blocking/static/description/index.html @@ -369,8 +369,9 @@

Project task parent completion blocking

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:d3e2eadb57ab9a1d05c17ebc2d3950a473504aebc8d4a267af34707905547ac9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

Prevents a parent task from beeing completed if a child task isn’t completed.

+

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

+

Prevents a parent task from beeing completed if a child task isn’t +completed.

Table of contents

    @@ -388,7 +389,7 @@

    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.

    +feedback.

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

@@ -420,7 +421,7 @@

Maintainers

promote its widespread use.

Current maintainer:

david-banon-tecnativa

-

This module is part of the OCA/project project on GitHub.

+

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.

From f16d31cc1086c3ceefb3c56d3ac12c822a791994 Mon Sep 17 00:00:00 2001 From: david-banon-tecnativa Date: Wed, 30 Apr 2025 19:08:30 +0200 Subject: [PATCH 04/12] [MIG] project_task_parent_completion_blocking: Migration to version 18.0 TT56201 --- .../README.rst | 3 +- .../__manifest__.py | 2 +- .../i18n/es.po | 5 +- .../i18n/it.po | 3 +- ...roject_task_parent_completion_blocking.pot | 5 +- .../readme/DESCRIPTION.md | 3 +- .../static/description/index.html | 3 +- ...project_task_parent_completion_blocking.py | 47 +++++++------------ 8 files changed, 26 insertions(+), 45 deletions(-) diff --git a/project_task_parent_completion_blocking/README.rst b/project_task_parent_completion_blocking/README.rst index 191ba649e8..d4bda382a6 100644 --- a/project_task_parent_completion_blocking/README.rst +++ b/project_task_parent_completion_blocking/README.rst @@ -28,8 +28,7 @@ Project task parent completion blocking |badge1| |badge2| |badge3| |badge4| |badge5| -Prevents a parent task from beeing completed if a child task isn't -completed. +Prevents a task from being completed if a child task isn't completed. **Table of contents** diff --git a/project_task_parent_completion_blocking/__manifest__.py b/project_task_parent_completion_blocking/__manifest__.py index 4bc7f0648b..40009cbf48 100644 --- a/project_task_parent_completion_blocking/__manifest__.py +++ b/project_task_parent_completion_blocking/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Project task parent completion blocking", - "version": "16.0.1.0.0", + "version": "18.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)", diff --git a/project_task_parent_completion_blocking/i18n/es.po b/project_task_parent_completion_blocking/i18n/es.po index a622b4cd76..0b1771cf49 100644 --- a/project_task_parent_completion_blocking/i18n/es.po +++ b/project_task_parent_completion_blocking/i18n/es.po @@ -6,8 +6,6 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-10 08:11+0000\n" -"PO-Revision-Date: 2025-04-10 10:15+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: es\n" @@ -24,7 +22,6 @@ msgstr "Tarea" #. module: project_task_parent_completion_blocking #. odoo-python -#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0 -#, python-format +#: 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." diff --git a/project_task_parent_completion_blocking/i18n/it.po b/project_task_parent_completion_blocking/i18n/it.po index b3a741d69d..e78c61a798 100644 --- a/project_task_parent_completion_blocking/i18n/it.po +++ b/project_task_parent_completion_blocking/i18n/it.po @@ -21,7 +21,6 @@ msgstr "" #. module: project_task_parent_completion_blocking #. odoo-python -#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0 -#, python-format +#: code:addons/project_task_parent_completion_blocking/models/project_task.py msgid "You can't close this task because it has open subtasks." msgstr "" diff --git a/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot index 287fd3fafd..b0ad19b48a 100644 --- a/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot +++ b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -20,7 +20,6 @@ msgstr "" #. module: project_task_parent_completion_blocking #. odoo-python -#: code:addons/project_task_parent_completion_blocking/models/project_task.py:0 -#, python-format +#: code:addons/project_task_parent_completion_blocking/models/project_task.py msgid "You can't close this task because it has open subtasks." msgstr "" diff --git a/project_task_parent_completion_blocking/readme/DESCRIPTION.md b/project_task_parent_completion_blocking/readme/DESCRIPTION.md index bf843a4e45..9677d6aaae 100644 --- a/project_task_parent_completion_blocking/readme/DESCRIPTION.md +++ b/project_task_parent_completion_blocking/readme/DESCRIPTION.md @@ -1,2 +1 @@ -Prevents a parent task from beeing completed if a child task isn't -completed. +Prevents a task from being completed if a child task isn't completed. diff --git a/project_task_parent_completion_blocking/static/description/index.html b/project_task_parent_completion_blocking/static/description/index.html index 12069d8fd7..b00037c335 100644 --- a/project_task_parent_completion_blocking/static/description/index.html +++ b/project_task_parent_completion_blocking/static/description/index.html @@ -370,8 +370,7 @@

Project task parent completion blocking

!! source digest: sha256:d3e2eadb57ab9a1d05c17ebc2d3950a473504aebc8d4a267af34707905547ac9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

-

Prevents a parent task from beeing completed if a child task isn’t -completed.

+

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

Table of contents

    diff --git a/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py b/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py index ff23f89f2c..80e5578a7f 100644 --- a/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py +++ b/project_task_parent_completion_blocking/tests/test_project_task_parent_completion_blocking.py @@ -1,31 +1,24 @@ from odoo.exceptions import ValidationError -from odoo.tests.common import TransactionCase +from odoo.addons.base.tests.common import BaseCommon -class TestParentChildBlock(TransactionCase): + +class TestParentChildBlock(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() - cls.test_project = ( - cls.env["project.project"] - .with_context(mail_create_nolog=True) - .create( - { - "name": "Test Project", - "privacy_visibility": "employees", - "alias_name": "project+test", - } - ) + cls.test_project = cls.env["project.project"].create( + { + "name": "Test Project", + "privacy_visibility": "employees", + "alias_name": "project+test", + } ) - cls.parent_task = ( - cls.env["project.task"] - .with_context(mail_create_nolog=True) - .create({"name": "Pigs UserTask", "project_id": cls.test_project.id}) + cls.parent_task = cls.env["project.task"].create( + {"name": "Pigs UserTask", "project_id": cls.test_project.id} ) - cls.child_task = ( - cls.env["project.task"] - .with_context(mail_create_nolog=True) - .create({"name": "Pigs ManagerTask", "project_id": cls.test_project.id}) + cls.child_task = cls.env["project.task"].create( + {"name": "Pigs ManagerTask", "project_id": cls.test_project.id} ) cls.stage_pending = cls.env["project.task.type"].create( @@ -41,15 +34,11 @@ def setUpClass(cls): def test_child_blocks_parent(self): with self.assertRaises(ValidationError): self.parent_task.stage_id = self.stage_done - extra_task = ( - self.env["project.task"] - .with_context(mail_create_nolog=True) - .create( - { - "name": "Test Task 3", - "project_id": self.test_project.id, - } - ) + extra_task = self.env["project.task"].create( + { + "name": "Test Task 3", + "project_id": self.test_project.id, + } ) self.parent_task.child_ids += extra_task extra_task.stage_id = self.stage_done From 50262df6acbe946184cbb1828e4e941bdd31fda6 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 3 May 2025 10:13:07 +0000 Subject: [PATCH 05/12] [UPD] Update project_task_parent_completion_blocking.pot --- .../i18n/project_task_parent_completion_blocking.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot index b0ad19b48a..01ced808a3 100644 --- a/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot +++ b/project_task_parent_completion_blocking/i18n/project_task_parent_completion_blocking.pot @@ -20,6 +20,6 @@ msgstr "" #. module: project_task_parent_completion_blocking #. odoo-python -#: code:addons/project_task_parent_completion_blocking/models/project_task.py +#: 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 "" From 76700057ad9444e36c088701f8ae7fc0dc1e16e4 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 3 May 2025 10:15:52 +0000 Subject: [PATCH 06/12] [BOT] post-merge updates --- project_task_parent_completion_blocking/README.rst | 2 +- .../static/description/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project_task_parent_completion_blocking/README.rst b/project_task_parent_completion_blocking/README.rst index d4bda382a6..c578b4e4ad 100644 --- a/project_task_parent_completion_blocking/README.rst +++ b/project_task_parent_completion_blocking/README.rst @@ -7,7 +7,7 @@ Project task parent completion blocking !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:d3e2eadb57ab9a1d05c17ebc2d3950a473504aebc8d4a267af34707905547ac9 + !! source digest: sha256:be6a7d57271ec3af2f04902a6940f90e9d0d895ffc568dc3011b54cbf28f7fcf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/project_task_parent_completion_blocking/static/description/index.html b/project_task_parent_completion_blocking/static/description/index.html index b00037c335..baf3f187df 100644 --- a/project_task_parent_completion_blocking/static/description/index.html +++ b/project_task_parent_completion_blocking/static/description/index.html @@ -367,7 +367,7 @@

    Project task parent completion blocking

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

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

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

    From 929e3c535c0d47cd1f2a3ea7ec044b92b2451f0a Mon Sep 17 00:00:00 2001 From: mymage Date: Mon, 5 May 2025 13:20:27 +0000 Subject: [PATCH 07/12] Translated using Weblate (Italian) Currently translated at 100.0% (2 of 2 strings) Translation: project-18.0/project-18.0-project_task_parent_completion_blocking Translate-URL: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_parent_completion_blocking/it/ --- project_task_parent_completion_blocking/i18n/it.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project_task_parent_completion_blocking/i18n/it.po b/project_task_parent_completion_blocking/i18n/it.po index e78c61a798..87466cef5b 100644 --- a/project_task_parent_completion_blocking/i18n/it.po +++ b/project_task_parent_completion_blocking/i18n/it.po @@ -6,21 +6,23 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2025-05-05 14:55+0000\n" +"Last-Translator: mymage \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 "" +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 "" +msgstr "Non si può chiudere il lavoro perché ha dei sotto lavori aperti." From 547c02b305d7111968addf331046003716bdcc53 Mon Sep 17 00:00:00 2001 From: mymage Date: Mon, 5 May 2025 13:20:27 +0000 Subject: [PATCH 08/12] Translated using Weblate (Italian) Currently translated at 100.0% (2 of 2 strings) Translation: project-18.0/project-18.0-project_task_parent_completion_blocking Translate-URL: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_parent_completion_blocking/it/ --- project_task_parent_completion_blocking/i18n/it.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_task_parent_completion_blocking/i18n/it.po b/project_task_parent_completion_blocking/i18n/it.po index 87466cef5b..db76f99f5e 100644 --- a/project_task_parent_completion_blocking/i18n/it.po +++ b/project_task_parent_completion_blocking/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2025-05-05 14:55+0000\n" +"PO-Revision-Date: 2025-05-05 14:57+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" From aa49f3ed403605483333774e90f6b09fd06d7da8 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 22 May 2025 18:15:02 +0000 Subject: [PATCH 09/12] Added translation using Weblate (Portuguese (Brazil)) --- .../i18n/pt_BR.po | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 project_task_parent_completion_blocking/i18n/pt_BR.po diff --git a/project_task_parent_completion_blocking/i18n/pt_BR.po b/project_task_parent_completion_blocking/i18n/pt_BR.po new file mode 100644 index 0000000000..0038fcfb36 --- /dev/null +++ b/project_task_parent_completion_blocking/i18n/pt_BR.po @@ -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 "" From 8e0f0d28f1b6268aef75c1b4257150303446d75a Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 30 Jun 2026 04:09:27 +0000 Subject: [PATCH 10/12] Added translation using Weblate (Slovenian) --- .../i18n/sl.po | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 project_task_parent_completion_blocking/i18n/sl.po diff --git a/project_task_parent_completion_blocking/i18n/sl.po b/project_task_parent_completion_blocking/i18n/sl.po new file mode 100644 index 0000000000..4cc9458a2c --- /dev/null +++ b/project_task_parent_completion_blocking/i18n/sl.po @@ -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 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. 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 "" From 01a8e5eb8775102e2a9538b4d96cf2a90530f3fc Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 30 Jun 2026 04:12:44 +0000 Subject: [PATCH 11/12] Translated using Weblate (Slovenian) Currently translated at 100.0% (2 of 2 strings) Translation: project-18.0/project-18.0-project_task_parent_completion_blocking Translate-URL: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_parent_completion_blocking/sl/ --- project_task_parent_completion_blocking/i18n/sl.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project_task_parent_completion_blocking/i18n/sl.po b/project_task_parent_completion_blocking/i18n/sl.po index 4cc9458a2c..d246ab4e1d 100644 --- a/project_task_parent_completion_blocking/i18n/sl.po +++ b/project_task_parent_completion_blocking/i18n/sl.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-06-30 04:14+0000\n" +"Last-Translator: Matjaz Mozetic \n" "Language-Team: none\n" "Language: sl\n" "MIME-Version: 1.0\n" @@ -14,14 +15,15 @@ msgstr "" "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 "" +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 "" +msgstr "Tega opravila ne morete zapreti, ker ima odprta podrejena opravila." From 514899be8eb065f737405d4e5e7a3e01f01c96e7 Mon Sep 17 00:00:00 2001 From: kalpeshgajera-uncannycs Date: Fri, 24 Jul 2026 18:45:40 +0530 Subject: [PATCH 12/12] [19.0][MIG]project_task_parent_completion_blocking: Migration to 19.0 --- .../README.rst | 16 +++++++---- .../__manifest__.py | 2 +- .../models/project_task.py | 6 ++-- .../static/description/index.html | 28 +++++++++++-------- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/project_task_parent_completion_blocking/README.rst b/project_task_parent_completion_blocking/README.rst index c578b4e4ad..89595bc490 100644 --- a/project_task_parent_completion_blocking/README.rst +++ b/project_task_parent_completion_blocking/README.rst @@ -1,3 +1,7 @@ +.. 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 ======================================= @@ -13,17 +17,17 @@ Project task parent completion blocking .. |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/licence-AGPL--3-blue.png +.. |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/18.0/project_task_parent_completion_blocking + :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-18-0/project-18-0-project_task_parent_completion_blocking + :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=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,7 +45,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -82,6 +86,6 @@ Current `maintainer `__: |maintainer-david-banon-tecnativa| -This module is part of the `OCA/project `_ project on GitHub. +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_task_parent_completion_blocking/__manifest__.py b/project_task_parent_completion_blocking/__manifest__.py index 40009cbf48..ffbf65845f 100644 --- a/project_task_parent_completion_blocking/__manifest__.py +++ b/project_task_parent_completion_blocking/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Project task parent completion blocking", - "version": "18.0.1.0.0", + "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)", diff --git a/project_task_parent_completion_blocking/models/project_task.py b/project_task_parent_completion_blocking/models/project_task.py index 6f3a53be6e..2687bb059e 100644 --- a/project_task_parent_completion_blocking/models/project_task.py +++ b/project_task_parent_completion_blocking/models/project_task.py @@ -1,4 +1,4 @@ -from odoo import _, api, models +from odoo import api, models from odoo.exceptions import ValidationError @@ -12,5 +12,7 @@ def _check_subtasks_done_before_closing(self): lambda t: not t.stage_id.fold ): raise ValidationError( - _("You can't close this task because it has open subtasks.") + self.env._( + "You can't close this task because it has open subtasks." + ) ) diff --git a/project_task_parent_completion_blocking/static/description/index.html b/project_task_parent_completion_blocking/static/description/index.html index baf3f187df..546edace9c 100644 --- a/project_task_parent_completion_blocking/static/description/index.html +++ b/project_task_parent_completion_blocking/static/description/index.html @@ -3,7 +3,7 @@ -Project task parent completion blocking +README.rst -
    -

    Project task parent completion blocking

    +
    + + +Odoo Community Association + +
    +

    Project task parent completion blocking

    -

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

    +

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

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

    Table of contents

    @@ -384,23 +389,23 @@

    Project task parent completion blocking

-

Bug Tracker

+

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.

+feedback.

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -420,10 +425,11 @@

Maintainers

promote its widespread use.

Current maintainer:

david-banon-tecnativa

-

This module is part of the OCA/project project on GitHub.

+

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.

+