Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TA#64810 [ADD] project_advanced_checklist #392

Merged
merged 2 commits into from
May 23, 2024
Merged
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
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"account_analytic_enhanced", # required for project_enhanced
"analytic_line_revenue",
"analytic_line_employee",
"project_advanced_checklist",
"project_analytic_group",
"project_chatter",
"project_closed",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ USER odoo
COPY account_analytic_enhanced /mnt/extra-addons/account_analytic_enhanced
COPY analytic_line_employee /mnt/extra-addons/analytic_line_employee
COPY analytic_line_revenue /mnt/extra-addons/analytic_line_revenue
COPY project_advanced_checklist /mnt/extra-addons/project_advanced_checklist
COPY project_analytic_group /mnt/extra-addons/project_analytic_group
COPY project_chatter /mnt/extra-addons/project_chatter
COPY project_closed /mnt/extra-addons/project_closed
Expand Down
46 changes: 46 additions & 0 deletions project_advanced_checklist/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Project Advanced Checklist
==========================
This module allows to use advanced checklist in tasks.

Key Features
------------
**Unlimited number of checklist**

.. image:: static/description/feature_1.png

**Unlimited number of items in each checklist**

.. image:: static/description/feature_2.png

**Only the manager can add or modify the checklist in the task**

.. image:: static/description/feature_3.png

**Render in kanban view**

.. image:: static/description/feature_4.png

Usage
-----
As a project manager, I carry out checklists,

I create a new checklist that contains the following fields:
-Name
-Description
-Items

.. image:: static/description/checklist_form_view.png

On the task, a new field `Checklist` is available.
By defining a checklist, a new tab is displayed, where the elements which constitute
the checklist are displayed accompanied by a progress bar.

.. image:: static/description/task_form_view.png

On the Kanban task view, the progress bar is displayed for tasks for which a checklist is defined.

.. image:: static/description/task_kanban_view.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
4 changes: 4 additions & 0 deletions project_advanced_checklist/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models

Check notice on line 4 in project_advanced_checklist/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_advanced_checklist/__init__.py#L4

'.models' imported but unused (F401)
20 changes: 20 additions & 0 deletions project_advanced_checklist/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{

Check warning on line 4 in project_advanced_checklist/__manifest__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_advanced_checklist/__manifest__.py#L4

Statement seems to have no effect
"name": "Project Advanced Checklist",
"version": "14.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"category": "Project",
"depends": ["project"],
"summary": "Add advanced checklist in tasks",
"data": [
"security/ir.model.access.csv",
"views/project_checklist.xml",
"views/project_task.xml",
],
"installable": True,
}
168 changes: 168 additions & 0 deletions project_advanced_checklist/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_advanced_checklist
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-22 22:24+0000\n"
"PO-Revision-Date: 2024-05-22 22:24+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_advanced_checklist
#: selection:project.task.checklist.item,result:0
msgid "Cancel"
msgstr "Annulé"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__checklist_id
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task__checklist_id
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_checklist_form
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_project_task_checklist_form
msgid "Checklist"
msgstr "Checklist"

#. module: project_advanced_checklist
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_task_checklist_item_form
msgid "Checklist Item"
msgstr "Élément de checklist"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task__checklist_progress
msgid "Checklist Progress"
msgstr "Progrès de la checklist"

#. module: project_advanced_checklist
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_checklist_form
msgid "Checklist Title..."
msgstr "Titre de la checklist..."

#. module: project_advanced_checklist
#: model:ir.actions.act_window,name:project_advanced_checklist.action_checklist_tree
#: model:ir.ui.menu,name:project_advanced_checklist.menu_checklist
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_checklist_tree
msgid "Checklists"
msgstr "Checklists"

#. module: project_advanced_checklist
#: selection:project.task.checklist.item,result:0
msgid "Complete"
msgstr "Complété"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__create_uid
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__create_uid
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__create_uid
msgid "Created by"
msgstr ""

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__create_date
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__create_date
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__create_date
msgid "Created on"
msgstr ""

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__description
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__description
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__description
msgid "Description"
msgstr "Description"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__display_name
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__display_name
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__display_name
msgid "Display Name"
msgstr "Nom affiché"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__id
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__id
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__id
msgid "ID"
msgstr "ID"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__item_ids
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task__checklist_item_ids
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_checklist_form
msgid "Items"
msgstr "Éléments"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist____last_update
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item____last_update
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item____last_update
msgid "Last Modified on"
msgstr ""

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__write_uid
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__write_uid
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__write_uid
msgid "Last Updated by"
msgstr ""

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__write_date
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__write_date
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__write_date
msgid "Last Updated on"
msgstr ""

#. module: project_advanced_checklist
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_project_task_checklist_form
msgid "Mark cancelled?"
msgstr "Marquer annulé"

#. module: project_advanced_checklist
#: model_terms:ir.ui.view,arch_db:project_advanced_checklist.view_project_task_checklist_form
msgid "Mark completed?"
msgstr "Marquer complété"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist__name
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__name
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__name
msgid "Name"
msgstr "Nom"

#. module: project_advanced_checklist
#: model:ir.model,name:project_advanced_checklist.model_project_checklist
msgid "Project Checklist"
msgstr "Checklist (projets)"

#. module: project_advanced_checklist
#: model:ir.model,name:project_advanced_checklist.model_project_checklist_item
msgid "Project Checklist Item"
msgstr "Élément de checklist"

#. module: project_advanced_checklist
#: model:ir.model,name:project_advanced_checklist.model_project_task_checklist_item
msgid "Project Task Checklist Item"
msgstr "Élément de checklist sur tâche"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__result
msgid "Result"
msgstr "Résultat"

#. module: project_advanced_checklist
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_checklist_item__sequence
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__sequence
msgid "Sequence"
msgstr "Séquence"

#. module: project_advanced_checklist
#: model:ir.model,name:project_advanced_checklist.model_project_task
#: model:ir.model.fields,field_description:project_advanced_checklist.field_project_task_checklist_item__task_id
msgid "Task"
msgstr "Tâche"
9 changes: 9 additions & 0 deletions project_advanced_checklist/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import (

Check notice on line 4 in project_advanced_checklist/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_advanced_checklist/models/__init__.py#L4

'.project_checklist' imported but unused (F401)
project_checklist,
project_checklist_item,
project_task,
project_task_checklist_item,
)
14 changes: 14 additions & 0 deletions project_advanced_checklist/models/project_checklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class Checklist(models.Model):
_name = "project.checklist"
_order = "name"
_description = "Project Checklist"

name = fields.Char(string="Name", required=True)
item_ids = fields.One2many("project.checklist.item", "checklist_id", string="Items")
description = fields.Char(string="Description")
18 changes: 18 additions & 0 deletions project_advanced_checklist/models/project_checklist_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ChecklistItem(models.Model):
_name = "project.checklist.item"
_order = "sequence"
_description = "Project Checklist Item"

checklist_id = fields.Many2one(
"project.checklist", ondelete="cascade", required=True
)

sequence = fields.Integer(default=1)
name = fields.Char(string="Name")
description = fields.Char(string="Description")
45 changes: 45 additions & 0 deletions project_advanced_checklist/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class Task(models.Model):

_inherit = ["project.task"]

checklist_id = fields.Many2one("project.checklist", string="Checklist")
checklist_item_ids = fields.One2many(
"project.task.checklist.item",
"task_id",
string="Items",
copy=True,
)
checklist_progress = fields.Float(
string="Checklist Progress", compute="_compute_checklist_progress"
)

@api.depends("checklist_item_ids")
def _compute_checklist_progress(self):
for record in self:
sum_done = sum(1 for i in record.checklist_item_ids if i.result)
total_items = len(record.checklist_item_ids)
progress = (sum_done / total_items) * 100 if total_items else 0
record.checklist_progress = progress or 0.01

@api.onchange("checklist_id")
def _onchange_checklist(self):
self.checklist_item_ids = [
(5, 0),
*(
(0, 0, self._make_checklist_item_vals(i))
for i in self.checklist_id.item_ids
),
]

def _make_checklist_item_vals(self, item):
return {
"sequence": item.sequence,
"name": item.name,
"description": item.description,
}
26 changes: 26 additions & 0 deletions project_advanced_checklist/models/project_task_checklist_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class TaskChecklistItem(models.Model):
_name = "project.task.checklist.item"
_order = "sequence"
_description = "Project Task Checklist Item"

task_id = fields.Many2one("project.task", ondelete="restrict", required=True)
sequence = fields.Integer(default=1)
name = fields.Char(string="Name")
description = fields.Char(string="Description")
result = fields.Selection(
[("complete", "Complete"), ("cancel", "Cancel")],
string="Result",
readonly=True,
)

def click_done(self):
self.result = "complete"

def click_cancel(self):
self.result = "cancel"
7 changes: 7 additions & 0 deletions project_advanced_checklist/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_project_checklist_user,access_project_checklist_user,model_project_checklist,project.group_project_user,1,0,0,0
access_project_checklist_manager,access_project_checklist_manager,model_project_checklist,project.group_project_manager,1,1,1,1
access_project_checklist_item_user,access_project_checklist_item_user,model_project_checklist_item,project.group_project_user,1,0,0,0
access_project_checklist_item_manager,access_project_checklist_item_manager,model_project_checklist_item,project.group_project_manager,1,1,1,1
access_project_task_checklist_item_user,access_project_task_checklist_item_user,model_project_task_checklist_item,project.group_project_user,1,1,0,0
access_project_task_checklist_item_manager,access_project_task_checklist_item_manager,model_project_task_checklist_item,project.group_project_manager,1,1,1,1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions project_advanced_checklist/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import test__project_checklist

Check notice on line 4 in project_advanced_checklist/tests/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_advanced_checklist/tests/__init__.py#L4

'.test__project_checklist' imported but unused (F401)
Loading
Loading