Project Template

Define templates for projects and tasks

Technical Name:
project_template
License:
Author:
Numigi
Website:
https://kastor.lab.numigi.net/web/image/product.template/1266/image_1920?unique=0a81b40
  • Odoo Version

Conditions générales
Garantie satisfait ou remboursé de 30 jours
Expédition : 2-3 jours ouvrables

Project Template

This module allows to define project and task templates.

Task Templates

As member of Projects / User, I go to the form view of a task.

I notice a new checkbox Is Template under the Extra Info tab.

static/description/task_template_form_checkbox.png

I check the box.

A warning message is displayed on the form view to signal that the task is a template.

static/description/task_template_form_warning.png

I save the template.

Hidden Fields

Multiple fields are hidden in the form of view of task templates including:

  • Assigned To
  • Customer
  • Kanban State
  • Date Fields
  • Timesheets (see module project_template_timesheet)

These fields are not relevant for a template.

Some irrelevant smart buttons are also hidden.

Making a Field Invisible

To make a field (or any other xml node) hidden only for task templates, you may inherit the form view and add a special attribute:

<field name="my_task_field" position="attributes">
    <attribute name="invisible_on_template">1</attribute>
</field>

This is equivalent to:

<field name="my_task_field" position="attributes">
    <attribute name="attrs">{'invisible': [('is_template', '=', True)]}</attribute>
</field>

One advantage of the invisible_on_template is to prevent conflicts with other modifiers.

Also, when a field uses invisible_on_template="1". The field will never be required for a template.

Search Filters

By default, tasks flagged as template do not appear in search results.

static/description/task_kanban_without_templates.png

Tasks templates can be shown by activating the Task Templates filter.

static/description/task_template_filter.png

By selecting both Task Templates and Tasks filters, both templates and normal tasks are shown together.

static/description/task_template_and_tasks_filter.png

Adding Template Tasks to a Project

As member of Projects / Manager, I go to the form view of a project.

I notice a new button Add Task Templates.

static/description/add_task_template_button.png

I click on the button. A wizard is opened.

static/description/add_task_template_wizard.png

The wizard allows to select one or multiple task templates.

I select my task template and validate.

static/description/add_task_template_wizard_validate.png

Back on my project, I notice that I have one task template.

static/description/project_task_template_smart_button.png

If I click on the button, I see the list view of templates under my project.

static/description/project_task_template_list.png

How This Works

Behind the scene, each selected task template is copied to create a new task template under the project.

Therefore, after adding the template to the project, you may customize the template for your project, without impacting the master / main template.

Converting Templates To Tasks

Back to my project, I notice a button Convert Templates To Tasks.

static/description/convert_templates_to_tasks_button.png

After clicking on the button, I notice that I have one task.

static/description/project_task_smart_button.png

The Convert Templates To Tasks button has a clever mecanism.

Behind the scene, each task template under the project is copied to create a real task.

Idempotent

If a template was already converted into a task, it will not be converted again.

Subtasks

A template task may have subtasks (which must be templates as well).

In such case, each subtask inside the template task is also copied to create a real subtask.

If after clicking on the button, a new subtemplate is added to a template task, clicking a second time on the button will generate a real subtask.

Task / Subtasks Integrity

If a task is a template, then its subtasks must be templates as well. If a task is not a template, then its subtasks must not be templates.

When creating a subtask, the Is Template box is automatically propagated.

If a task is set as template, all its subtasks are automatically set as template.

Pivot Tables

In the pivot table of a task, a new field Template / Task allows to partition the table between templates and real tasks.

static/description/pivot_template_or_task.png static/description/pivot_table_partitioned.png

This can be usefull to compare:

  • Planned Hours on Templates (budgeted hours)
  • Planned Hours on Tasks
  • Spent Hours on Tasks

Known Issues

For now project templates are not implemented. This will be implemented in this module.

Integration with timesheets will also be implemented in a separate module (project_template_timesheet).

Contributors