-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG][16.0] project_task_description_template
- Loading branch information
Showing
19 changed files
with
306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Project Task Description Templates | ||
================================== | ||
This module allows to autocomplete descriptions on tasks. | ||
|
||
.. contents:: Table of Contents | ||
|
||
Context | ||
------- | ||
When using ``Projects`` for field interventions for example, the description of tasks is very repetitive. | ||
It is therefore convenient to automatically fill the description with a template. | ||
|
||
Usage | ||
----- | ||
As ``Project / Manager``, I go to ``Project / Configuration / Task Description Templates``. | ||
|
||
I find the list of description templates. | ||
|
||
.. image:: static/description/description_template_list.png | ||
|
||
Each record contains a name and a HTML description. | ||
|
||
.. image:: static/description/description_template_form.png | ||
|
||
In the form view of a task, I can select a description template. | ||
|
||
.. image:: static/description/task_form.png | ||
|
||
The description is automatically copied from the template. | ||
|
||
.. image:: static/description/task_form_description_filled.png | ||
|
||
Contributors | ||
------------ | ||
* Numigi (tm) and all its contributors (https://bit.ly/numigiens) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Project Task Description Template", | ||
"version": "16.0.1.0.0", | ||
"author": "Numigi", | ||
"maintainer": "Numigi", | ||
"website": "https://www.numigi.com", | ||
"license": "LGPL-3", | ||
"category": "Project", | ||
"summary": "Autocomplete task descriptions from templates", | ||
"depends": ["project"], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/project_task_views.xml", | ||
"views/task_description_template_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_task_description_template | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-22 13:35+0000\n" | ||
"PO-Revision-Date: 2024-11-22 13:35+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_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__active | ||
msgid "Active" | ||
msgstr "Actif" | ||
|
||
#. module: project_task_description_template | ||
#: model_terms:ir.ui.view,arch_db:project_task_description_template.project_task_description_template_search | ||
msgid "Archived" | ||
msgstr "Archivé" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__create_uid | ||
msgid "Created by" | ||
msgstr "Créé par" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__create_date | ||
msgid "Created on" | ||
msgstr "Créé le" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__description | ||
msgid "Description" | ||
msgstr "" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task__description_template_id | ||
msgid "Description Template" | ||
msgstr "Modèle de description" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__display_name | ||
msgid "Display Name" | ||
msgstr "Nom affiché" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière modification le" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__write_uid | ||
msgid "Last Updated by" | ||
msgstr "Dernière mise à jour par" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__write_date | ||
msgid "Last Updated on" | ||
msgstr "Dernière mise à jour le" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__name | ||
msgid "Name" | ||
msgstr "Nom" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model,name:project_task_description_template.model_project_task_description_template | ||
msgid "Project Task Description Template" | ||
msgstr "Modèles de description de tâches" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__sequence | ||
msgid "Sequence" | ||
msgstr "Séquence" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.model,name:project_task_description_template.model_project_task | ||
msgid "Task" | ||
msgstr "Tâche" | ||
|
||
#. module: project_task_description_template | ||
#: model_terms:ir.ui.view,arch_db:project_task_description_template.project_task_description_template_form | ||
msgid "Task Description Template" | ||
msgstr "Modèle de description de tâche" | ||
|
||
#. module: project_task_description_template | ||
#: model:ir.actions.act_window,name:project_task_description_template.project_task_description_template_action | ||
#: model:ir.ui.menu,name:project_task_description_template.project_task_description_template_menu | ||
#: model_terms:ir.ui.view,arch_db:project_task_description_template.project_task_description_template_list | ||
#: model_terms:ir.ui.view,arch_db:project_task_description_template.project_task_description_template_search | ||
msgid "Task Description Templates" | ||
msgstr "Modèles de description de tâches" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import project_task | ||
from . import project_task_description_template | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024-today Numigi 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 ProjectTask(models.Model): | ||
|
||
_inherit = "project.task" | ||
|
||
description_template_id = fields.Many2one( | ||
"project.task.description.template", ondelete="restrict" | ||
) | ||
|
||
@api.onchange("description_template_id") | ||
def _onchange_description_template(self): | ||
if self.description_template_id: | ||
self.description = self.description_template_id.description |
16 changes: 16 additions & 0 deletions
16
project_task_description_template/models/project_task_description_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024-today Numigi 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 ProjectTaskDescriptionTemplate(models.Model): | ||
|
||
_name = "project.task.description.template" | ||
_description = "Project Task Description Template" | ||
_order = "sequence" | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Html() | ||
active = fields.Boolean(default=True) | ||
sequence = fields.Integer() |
3 changes: 3 additions & 0 deletions
3
project_task_description_template/security/ir.model.access.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
access_project_task_description_template_user,project_task_description_template_user,model_project_task_description_template,base.group_user,1,0,0,0 | ||
access_project_task_description_template_manager,project_task_description_template_manager,model_project_task_description_template,project.group_project_manager,1,1,1,1 |
Binary file added
BIN
+41.4 KB
project_task_description_template/static/description/description_template_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.8 KB
project_task_description_template/static/description/description_template_list.png
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.
Binary file added
BIN
+70.8 KB
...t_task_description_template/static/description/task_form_description_filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_project_task |
20 changes: 20 additions & 0 deletions
20
project_task_description_template/tests/test_project_task.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests import Form | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestProjectTask(TransactionCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.template = cls.env["project.task.description.template"].create( | ||
{"name": "My Template", "description": "Lorem Ipsum"} | ||
) | ||
cls.task = cls.env["project.task"].create({"name": "My Task"}) | ||
|
||
def test_onchange_description_template(self): | ||
with Form(self.task) as task_form: | ||
task_form.description_template_id = self.template | ||
assert self.task.description == self.template.description |
15 changes: 15 additions & 0 deletions
15
project_task_description_template/views/project_task_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<odoo> | ||
|
||
<record id="view_task_form2" model="ir.ui.view"> | ||
<field name="name">Task form: Add description template</field> | ||
<field name="model">project.task</field> | ||
<field name="inherit_id" ref="project.view_task_form2"/> | ||
<field name="arch" type="xml"> | ||
<field name="user_ids" position="after"> | ||
<field name="description_template_id"/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
60 changes: 60 additions & 0 deletions
60
project_task_description_template/views/task_description_template_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="project_task_description_template_form" model="ir.ui.view"> | ||
<field name="name">Task Description Template Form</field> | ||
<field name="model">project.task.description.template</field> | ||
<field name="arch" type="xml"> | ||
<form string="Task Description Template"> | ||
<header> | ||
</header> | ||
<sheet> | ||
<group> | ||
<field name="name"/> | ||
<field name="description" widget="html"/> | ||
<field name="sequence"/> | ||
<field name="active"/> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="project_task_description_template_list" model="ir.ui.view"> | ||
<field name="name">Task Description Template List</field> | ||
<field name="model">project.task.description.template</field> | ||
<field name="arch" type="xml"> | ||
<tree string="Task Description Templates"> | ||
<field name="sequence" widget="handle"/> | ||
<field name="name"/> | ||
<field name="active"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="project_task_description_template_search" model="ir.ui.view"> | ||
<field name="name">Task Description Template Search</field> | ||
<field name="model">project.task.description.template</field> | ||
<field name="arch" type="xml"> | ||
<search string="Task Description Templates"> | ||
<field name="name"/> | ||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id="project_task_description_template_action" model="ir.actions.act_window"> | ||
<field name="name">Task Description Templates</field> | ||
<field name="res_model">project.task.description.template</field> | ||
<field name="view_mode">tree,form</field> | ||
</record> | ||
|
||
<menuitem | ||
id="project_task_description_template_menu" | ||
name="Task Description Templates" | ||
parent="project.menu_project_config" | ||
action="project_task_description_template_action" | ||
sequence="200" | ||
/> | ||
|
||
</odoo> |