diff --git a/project_my_tasks_by_stage/__manifest__.py b/project_my_tasks_by_stage/__manifest__.py index ae0c233f..38b77165 100644 --- a/project_my_tasks_by_stage/__manifest__.py +++ b/project_my_tasks_by_stage/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Project My Tasks By Stage", - "version": "19.0.1.0.0", + "version": "20.0.1.0.0", "category": "Services/Project", "sequence": 50, "summary": "", @@ -14,7 +14,7 @@ "data": [ "views/project_task_views.xml", ], - "installable": False, + "installable": True, "auto_install": False, "application": False, } diff --git a/project_my_tasks_by_stage/i18n/es.po b/project_my_tasks_by_stage/i18n/es.po index db80dcab..7c8e9ac8 100644 --- a/project_my_tasks_by_stage/i18n/es.po +++ b/project_my_tasks_by_stage/i18n/es.po @@ -4,3 +4,82 @@ msgstr "" "Language-Team: Spanish (https://app.transifex.com/adhoc/teams/46451/es/)\n" "Language: es\n" "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#. module: project_my_tasks_by_stage +#: model:ir.module.module,description:base.module_project_my_tasks_by_stage +msgid "" +".. |company| replace:: ADHOC SA\n" +"\n" +".. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png\n" +" :alt: ADHOC SA\n" +" :target: https://www.adhoc.com.ar\n" +"\n" +".. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png\n" +"\n" +".. image:: https://img.shields.io/badge/license-AGPL--3-blue.png\n" +" :target: https://www.gnu.org/licenses/agpl\n" +" :alt: License: AGPL-3\n" +"\n" +"=========================\n" +"Project My Tasks By Stage\n" +"=========================\n" +"\n" +"This module is very useful if all the projects share the same tasks stages and changes the way tasks are displayed in the sub-menu \"My tasks\".\n" +"Instead of showing the user his tasks grouped by personal stages, now it will display them grouped by the project's task stage.\n" +"\n" +"Installation\n" +"============\n" +"\n" +"To install this module, you need to:\n" +"\n" +"#. Just install the module.\n" +"\n" +"Configuration\n" +"=============\n" +"\n" +"To configure this module, you need to:\n" +"\n" +"#. Nothing to configure\n" +"\n" +"Usage\n" +"=====\n" +"\n" +"#. Just Use the module.\n" +"\n" +".. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n" +" :alt: Try me on Runbot\n" +" :target: http://runbot.adhoc.com.ar/\n" +"\n" +"Bug Tracker\n" +"===========\n" +"\n" +"Bugs are tracked on `GitHub Issues\n" +"`_. In case of trouble, please\n" +"check there if your issue has already been reported. If you spotted it first,\n" +"help us smashing it by providing a detailed and welcomed feedback.\n" +"\n" +"Credits\n" +"=======\n" +"\n" +"Images\n" +"------\n" +"\n" +"* |company| |icon|\n" +"\n" +"Contributors\n" +"------------\n" +"\n" +"Maintainer\n" +"----------\n" +"\n" +"|company_logo|\n" +"\n" +"This module is maintained by the |company|.\n" +"\n" +"To contribute to this module, please visit https://www.adhoc.com.ar.\n" +msgstr "" + +#. module: project_my_tasks_by_stage +#: model:ir.module.module,shortdesc:base.module_project_my_tasks_by_stage +msgid "Project My Tasks By Stage" +msgstr "Proyecto: Mis tareas por etapa" diff --git a/project_my_tasks_by_stage/i18n/project_my_tasks_by_stage.pot b/project_my_tasks_by_stage/i18n/project_my_tasks_by_stage.pot new file mode 100644 index 00000000..96503fe3 --- /dev/null +++ b/project_my_tasks_by_stage/i18n/project_my_tasks_by_stage.pot @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_my_tasks_by_stage +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 20.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-10-27 19:21+0000\n" +"PO-Revision-Date: 2026-10-27 19:21+0000\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_my_tasks_by_stage +#: model:ir.module.module,description:base.module_project_my_tasks_by_stage +msgid "" +".. |company| replace:: ADHOC SA\n" +"\n" +".. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png\n" +" :alt: ADHOC SA\n" +" :target: https://www.adhoc.com.ar\n" +"\n" +".. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png\n" +"\n" +".. image:: https://img.shields.io/badge/license-AGPL--3-blue.png\n" +" :target: https://www.gnu.org/licenses/agpl\n" +" :alt: License: AGPL-3\n" +"\n" +"=========================\n" +"Project My Tasks By Stage\n" +"=========================\n" +"\n" +"This module is very useful if all the projects share the same tasks stages and changes the way tasks are displayed in the sub-menu \"My tasks\".\n" +"Instead of showing the user his tasks grouped by personal stages, now it will display them grouped by the project's task stage.\n" +"\n" +"Installation\n" +"============\n" +"\n" +"To install this module, you need to:\n" +"\n" +"#. Just install the module.\n" +"\n" +"Configuration\n" +"=============\n" +"\n" +"To configure this module, you need to:\n" +"\n" +"#. Nothing to configure\n" +"\n" +"Usage\n" +"=====\n" +"\n" +"#. Just Use the module.\n" +"\n" +".. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n" +" :alt: Try me on Runbot\n" +" :target: http://runbot.adhoc.com.ar/\n" +"\n" +"Bug Tracker\n" +"===========\n" +"\n" +"Bugs are tracked on `GitHub Issues\n" +"`_. In case of trouble, please\n" +"check there if your issue has already been reported. If you spotted it first,\n" +"help us smashing it by providing a detailed and welcomed feedback.\n" +"\n" +"Credits\n" +"=======\n" +"\n" +"Images\n" +"------\n" +"\n" +"* |company| |icon|\n" +"\n" +"Contributors\n" +"------------\n" +"\n" +"Maintainer\n" +"----------\n" +"\n" +"|company_logo|\n" +"\n" +"This module is maintained by the |company|.\n" +"\n" +"To contribute to this module, please visit https://www.adhoc.com.ar.\n" +msgstr "" + +#. module: project_my_tasks_by_stage +#: model:ir.module.module,shortdesc:base.module_project_my_tasks_by_stage +msgid "Project My Tasks By Stage" +msgstr "" diff --git a/project_my_tasks_by_stage/tests/__init__.py b/project_my_tasks_by_stage/tests/__init__.py new file mode 100644 index 00000000..ddf49b2a --- /dev/null +++ b/project_my_tasks_by_stage/tests/__init__.py @@ -0,0 +1 @@ +from . import test_my_tasks_by_stage diff --git a/project_my_tasks_by_stage/tests/test_my_tasks_by_stage.py b/project_my_tasks_by_stage/tests/test_my_tasks_by_stage.py new file mode 100644 index 00000000..933701dd --- /dev/null +++ b/project_my_tasks_by_stage/tests/test_my_tasks_by_stage.py @@ -0,0 +1,45 @@ +from lxml import etree +from odoo.tests.common import TransactionCase +from odoo.tools.safe_eval import safe_eval + + +class TestMyTasksByStage(TransactionCase): + def setUp(self): + super().setUp() + self.action = self.env.ref("project.action_view_my_task") + self.context = safe_eval(self.action.context, {"uid": self.env.uid}) + + def _default_group_by(self, view_mode): + view = self.action.view_ids.filtered(lambda v: v.view_mode == view_mode).view_id + arch = self.env["project.task"].get_view(view.id, view_mode)["arch"] + return etree.fromstring(arch).get("default_group_by") + + def test_my_tasks_views_group_by_project_stage(self): + """My Tasks must group by the project task stage, not the personal one.""" + self.assertEqual(self._default_group_by("list"), "stage_id") + self.assertEqual(self._default_group_by("kanban"), "stage_id") + + def test_action_context_is_not_overridden(self): + """The context stays with the one of Odoo, so it does not clash with other modules.""" + self.assertNotIn("group_by", self.context) + self.assertEqual(self.context["search_default_open_tasks"], 1) + self.assertEqual(self.context["default_user_ids"], [(4, self.env.uid)]) + + def test_grouping_by_stage_is_valid_on_tasks(self): + """The grouping of the views must be accepted by the task model.""" + stage = self.env["project.task.type"].create({"name": "Stage"}) + project = self.env["project.project"].create({"name": "Project", "type_ids": [(6, 0, stage.ids)]}) + self.env["project.task"].create( + { + "name": "Task", + "project_id": project.id, + "stage_id": stage.id, + "user_ids": [(4, self.env.uid)], + } + ) + groups = self.env["project.task"]._read_group( + [("user_ids", "in", self.env.uid)], + groupby=[self._default_group_by("list")], + aggregates=["__count"], + ) + self.assertIn(stage, [group[0] for group in groups]) diff --git a/project_my_tasks_by_stage/views/project_task_views.xml b/project_my_tasks_by_stage/views/project_task_views.xml index 9142d399..ebf8cabd 100644 --- a/project_my_tasks_by_stage/views/project_task_views.xml +++ b/project_my_tasks_by_stage/views/project_task_views.xml @@ -1,6 +1,24 @@ - - {'search_default_open_tasks': 1, 'all_task': 0, 'default_user_ids': [(4, uid)], 'group_by': 'stage_id'} + + project.task.kanban.inherit.my.task.by.stage + project.task + + + + stage_id + + + + + + open.view.my.tasks.list.view.by.stage + project.task + + + + stage_id + +