Skip to content
Closed
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
4 changes: 2 additions & 2 deletions project_my_tasks_by_stage/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "",
Expand All @@ -14,7 +14,7 @@
"data": [
"views/project_task_views.xml",
],
"installable": False,
"installable": True,
"auto_install": False,
"application": False,
}
79 changes: 79 additions & 0 deletions project_my_tasks_by_stage/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"<https://github.com/ingadhoc/project/issues>`_. 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"
95 changes: 95 additions & 0 deletions project_my_tasks_by_stage/i18n/project_my_tasks_by_stage.pot
Original file line number Diff line number Diff line change
@@ -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"
"<https://github.com/ingadhoc/project/issues>`_. 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 ""
1 change: 1 addition & 0 deletions project_my_tasks_by_stage/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_my_tasks_by_stage
45 changes: 45 additions & 0 deletions project_my_tasks_by_stage/tests/test_my_tasks_by_stage.py
Original file line number Diff line number Diff line change
@@ -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])
22 changes: 20 additions & 2 deletions project_my_tasks_by_stage/views/project_task_views.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project.action_view_my_task" model="ir.actions.act_window">
<field name="context">{'search_default_open_tasks': 1, 'all_task': 0, 'default_user_ids': [(4, uid)], 'group_by': 'stage_id'}</field>
<record id="view_task_kanban_inherit_my_task" model="ir.ui.view">
<field name="name">project.task.kanban.inherit.my.task.by.stage</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_kanban_inherit_my_task"/>
<field name="arch" type="xml">
<kanban position="attributes">
<attribute name="default_group_by">stage_id</attribute>
</kanban>
</field>
</record>

<record id="open_view_my_tasks_list_view" model="ir.ui.view">
<field name="name">open.view.my.tasks.list.view.by.stage</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.open_view_my_tasks_list_view"/>
<field name="arch" type="xml">
<list position="attributes">
<attribute name="default_group_by">stage_id</attribute>
</list>
</field>
</record>
</odoo>
Loading