Skip to content

Commit

Permalink
Merge PR #1147 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Oct 10, 2023
2 parents c6dd54c + 2812d76 commit cca56a0
Show file tree
Hide file tree
Showing 17 changed files with 772 additions and 0 deletions.
80 changes: 80 additions & 0 deletions project_task_description_template/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
=================================
Project Task Description Template
=================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/15.0/project_task_description_template
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_task_description_template
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/project&target_branch=15.0
:alt: Try me on Runboat

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

This module allow to define description templates for a task and use them to generate the description of the task.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module:

Select the description template you want to use in a 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_task_description_template%0Aversion:%2015.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
~~~~~~~

* Jarsa

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

* Alan Ramos <[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/15.0/project_task_description_template>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions project_task_description_template/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2023 - Jarsa
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).

from . import models
19 changes: 19 additions & 0 deletions project_task_description_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 - Jarsa
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
{
"name": "Project Task Description Template",
"summary": "Add a description template to project tasks",
"version": "15.0.1.0.0",
"category": "Project Management",
"author": "Jarsa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"license": "LGPL-3",
"installable": True,
"depends": ["project"],
"data": [
"security/ir.model.access.csv",
"security/ir_rule_data.xml",
"views/project_task_view.xml",
"views/project_task_description_template_view.xml",
],
}
104 changes: 104 additions & 0 deletions project_task_description_template/i18n/es_MX.po
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 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-04 00:23+0000\n"
"PO-Revision-Date: 2023-07-03 18:24-0600\n"
"Last-Translator: Jesús Alan Ramos Rodríguez <[email protected]>\n"
"Language-Team: \n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.3.2\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 "Activo"

#. module: project_task_description_template
#: model_terms:ir.actions.act_window,help:project_task_description_template.project_task_description_template_action
msgid "Click to create a new description template."
msgstr "Haga clic para crear una nueva plantilla de descripción."

#. module: project_task_description_template
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__company_id
msgid "Company"
msgstr "Compañía"

#. 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 "Creado por"

#. 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 "Creado en"

#. module: project_task_description_template
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__description
#: model_terms:ir.ui.view,arch_db:project_task_description_template.project_task_description_template_view_form
msgid "Description"
msgstr "Descripción"

#. 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 "Descripción Plantilla"

#. 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 "Nombre para mostrar"

#. module: project_task_description_template
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__id
msgid "ID"
msgstr "ID"

#. 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 "Última modificación el"

#. 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 "Ultima actualización por"

#. 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 "Ultima actualización en"

#. module: project_task_description_template
#: model:ir.model.fields,field_description:project_task_description_template.field_project_task_description_template__name
msgid "Name"
msgstr "Nombre"

#. module: project_task_description_template
#: model:ir.model,name:project_task_description_template.model_project_task_description_template
msgid "Project Task Description Template"
msgstr "Plantilla de descripción de tareas del proyecto"

#. module: project_task_description_template
#: model:ir.model,name:project_task_description_template.model_project_task
msgid "Task"
msgstr "Tarea"

#. module: project_task_description_template
#: model:ir.ui.menu,name:project_task_description_template.project_task_description_template_menu
msgid "Task Description Templates"
msgstr "Plantillas de descripción de tareas"

#. module: project_task_description_template
#: model:ir.actions.act_window,name:project_task_description_template.project_task_description_template_action
msgid "Task Description template"
msgstr "Plantilla de descripción de tareas"
5 changes: 5 additions & 0 deletions project_task_description_template/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2023 - Jarsa
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).

from . import project_task
from . import project_task_description_template
18 changes: 18 additions & 0 deletions project_task_description_template/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 - Jarsa
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).

from odoo import api, fields, models


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

description_template_id = fields.Many2one(
"project.task.description.template", store=False
)

@api.onchange("description_template_id")
def _onchange_description_template_id(self):
if self.description_template_id:
description = self.description if self.description else ""
self.description = description + self.description_template_id.description
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 - Jarsa
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).

from odoo import fields, models


class ProjectTaskDescriptionTemplate(models.Model):
_name = "project.task.description.template"
_description = "Project Task Description Template"

name = fields.Char(required=True)
description = fields.Html(required=True)
active = fields.Boolean(default=True)
company_id = fields.Many2one("res.company", default=lambda self: self.env.company)
1 change: 1 addition & 0 deletions project_task_description_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Alan Ramos <[email protected]>
1 change: 1 addition & 0 deletions project_task_description_template/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allow to define description templates for a task and use them to generate the description of the task.
3 changes: 3 additions & 0 deletions project_task_description_template/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To use this module:

Select the description template you want to use in a task.
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_model_project_task_description_template,access_model_project_task_description_template,model_project_task_description_template,project.group_project_manager,1,1,1,1
access_model_project_task_description_template_user,access_model_project_task_description_template_user,model_project_task_description_template,project.group_project_user,1,0,0,0
16 changes: 16 additions & 0 deletions project_task_description_template/security/ir_rule_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="project_task_description_template_company_ruyle" model="ir.rule">
<field name="name">Project Task Description Template Company Rule</field>
<field name="model_id" ref="model_project_task_description_template" />
<field
name="domain_force"
>['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
</record>

</odoo>
Loading

0 comments on commit cca56a0

Please sign in to comment.