Skip to content

Commit

Permalink
Merge PR #868 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Feb 2, 2022
2 parents 66cf1c8 + 8bfe5ab commit 501c710
Show file tree
Hide file tree
Showing 24 changed files with 921 additions and 0 deletions.
93 changes: 93 additions & 0 deletions project_parent_task_filter/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
==========================
Project Parent Task Filter
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/14.0/project_parent_task_filter
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_parent_task_filter
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/140/14.0
:alt: Try me on Runbot

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

This module adds a filter to show only the parent tasks in a project and
a group to sort tasks by its parent tasks.
It also adds the subtask number in the kanban view and activates the use
of subtasks in the project settings.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Activate the subtasks for each project record individually
#. Select the filter or the filter group Parent tasks in a Project

Known issues / Roadmap
======================

* In Products of type Service add an option to create a subtask of an existing task

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_parent_task_filter%0Aversion:%2014.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
~~~~~~~

* C2i Change 2 improve

Contributors
~~~~~~~~~~~~

* `C2i Change 2 improve <http://c2i.es/>`_:

* Eduardo Magdalena <[email protected]>

* Stephan Keller <[email protected]>

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.

This module is part of the `OCA/project <https://github.com/OCA/project/tree/14.0/project_parent_task_filter>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
17 changes: 17 additions & 0 deletions project_parent_task_filter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from . import models

from odoo import api, SUPERUSER_ID


def _add_task_display_project(cr, registry):
"""This hook is used to set display_project_id field to the tasks that have a project_id set
but empty display_project_id.
This makes subtasks created in the Sub-task page of the parent Task visible in the project
kanban view"""

env = api.Environment(cr, SUPERUSER_ID, {})
tasks = env["project.task"].search(
[("parent_id", "!=", False), ("display_project_id", "=", False)]
)
for task in tasks:
task.write({"display_project_id": task.parent_id.project_id.id})
16 changes: 16 additions & 0 deletions project_parent_task_filter/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2017 C2i Change 2 improve - Eduardo Magdalena <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Project Parent Task Filter",
"summary": "Add a filter to show the parent tasks",
"version": "15.0.1.0.0",
"category": "Project",
"website": "https://github.com/OCA/project",
"author": "C2i Change 2 improve, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["project"],
"data": ["data/res_config_data.xml", "views/project_task.xml"],
"installable": True,
"post_init_hook": "_add_task_display_project",
}
14 changes: 14 additions & 0 deletions project_parent_task_filter/data/res_config_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">

<record id="project_config_settings" model="res.config.settings">
<field name="group_subtask_project" eval="True" />
</record>
<function model="res.config.settings" name="execute">
<value
model="res.config.settings"
search="[('id', '=', ref('project_config_settings'))]"
/>
</function>

</odoo>
27 changes: 27 additions & 0 deletions project_parent_task_filter/i18n/ca.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-02-02 21:13+0000\n"
"Last-Translator: eduardgm <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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 3.10\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent task"
msgstr "Tasca pare"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Tasques pares"
27 changes: 27 additions & 0 deletions project_parent_task_filter/i18n/de.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-07-09 13:43+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
"Language-Team: none\n"
"Language: de\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 3.7.1\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent task"
msgstr "Übergeordnete Aufgabe"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Übergeordnete Aufgaben"
27 changes: 27 additions & 0 deletions project_parent_task_filter/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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-04-24 23:15+0000\n"
"Last-Translator: Eduardo Magdalena <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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 3.5.1\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent task"
msgstr "Tarea padre"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Tareas padre"
22 changes: 22 additions & 0 deletions project_parent_task_filter/i18n/es_AR.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-01 03:48+0000\n"
"Last-Translator: Ignacio Buioli <[email protected]>\n"
"Language-Team: none\n"
"Language: es_AR\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 4.3.2\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Tareas de padres"
25 changes: 25 additions & 0 deletions project_parent_task_filter/i18n/es_ES.po
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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: es_ES\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_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent task"
msgstr ""

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr ""
22 changes: 22 additions & 0 deletions project_parent_task_filter/i18n/fr.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-05-14 18:47+0000\n"
"Last-Translator: Yves Le Doeuff <[email protected]>\n"
"Language-Team: none\n"
"Language: fr\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 4.3.2\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Tâches parentes"
22 changes: 22 additions & 0 deletions project_parent_task_filter/i18n/fr_FR.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-11 16:46+0000\n"
"Last-Translator: Yves Le Doeuff <[email protected]>\n"
"Language-Team: none\n"
"Language: fr_FR\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 4.3.2\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Tâches parentes"
22 changes: 22 additions & 0 deletions project_parent_task_filter/i18n/nl_NL.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-01-28 09:44+0000\n"
"Last-Translator: Cas Vissers <[email protected]>\n"
"Language-Team: none\n"
"Language: nl_NL\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 4.3.2\n"

#. module: project_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr "Bovenliggende taken"
19 changes: 19 additions & 0 deletions project_parent_task_filter/i18n/project_parent_task_filter.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_parent_task_filter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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_parent_task_filter
#: model_terms:ir.ui.view,arch_db:project_parent_task_filter.view_task_search_form
msgid "Parent tasks"
msgstr ""
1 change: 1 addition & 0 deletions project_parent_task_filter/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
29 changes: 29 additions & 0 deletions project_parent_task_filter/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from odoo import api, models


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

@api.model_create_multi
def create(self, vals_list):
res = super(TaskSub, self).create(vals_list)
for vals in vals_list:
if vals.get("parent_id", False):
res["display_project_id"] = (
self.env["project.task"].browse(vals.get("parent_id")).project_id.id
)
return res

def action_subtask(self):
action = {
"type": "ir.actions.act_window",
"name": "Subtasks of " + self.name,
"res_model": "project.task",
"view_mode": "kanban,tree,form,calendar,pivot,graph,activity",
"search_view_id": [
self.env.ref("project.view_task_search_form").id,
"search",
],
"domain": [("id", "!=", self.id), ("id", "child_of", self.id)],
}
return action
Loading

0 comments on commit 501c710

Please sign in to comment.