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#72200 [MIG][16.0] project_task_ressource_type #454

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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 @@ -14,6 +14,7 @@
"project",
"project_task_date_planned",
"project_task_full_text_search",
"project_task_resource_type",
"project_type_advanced",
"project_default_task_stage",
"project_stage_allow_timesheet",
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 project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet
COPY project_task_date_planned /mnt/extra-addons/project_task_date_planned
COPY project_task_full_text_search /mnt/extra-addons/project_task_full_text_search
COPY project_task_resource_type /mnt/extra-addons/project_task_resource_type
COPY project_type_advanced /mnt/extra-addons/project_type_advanced
COPY project_default_task_stage /mnt/extra-addons/project_default_task_stage

Expand Down
35 changes: 35 additions & 0 deletions project_task_resource_type/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
================================
Project Task Resource Type
================================
This module adds a new model for Resources and a field to associate resources with tasks.

Resources can be defined in **Project > Configuration > Resources**.

.. image:: static/description/menu.png
:alt: Resource Menu
:align: center

From there, you can create a new resource type:

.. image:: static/description/resource_form_view.png
:alt: Resource Form View
:align: center

Once a resource type is created, you can assign it to a task:

.. image:: static/description/task_form_view.png
:alt: Task Form View
:align: center

Usage
-----
* Navigate to **Projects / Configuration / Resources** to define a resource type.
* Create a new resource type and assign it to tasks through the task form.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More Information
----------------
* Meet us at https://bit.ly/numigi-com
4 changes: 4 additions & 0 deletions project_task_resource_type/__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_task_resource_type/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_task_resource_type/__init__.py#L4

'.models' imported but unused (F401)
22 changes: 22 additions & 0 deletions project_task_resource_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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_task_resource_type/__manifest__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_task_resource_type/__manifest__.py#L4

Duplicate key 'license' in dictionary

Check warning on line 4 in project_task_resource_type/__manifest__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_task_resource_type/__manifest__.py#L4

Statement seems to have no effect
"name": "Project Task Resource Type",
"version": "16.0.1.0.0",
"description": "Add the referentiel Resource and the field to the tasks.",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "LGPL-3",
"category": "Project",
"depends": ["project"],
"data": [
"security/ir.model.access.csv",
"views/project_resource_views.xml",
"views/project_task_views.xml",
],
"application": False,
"license": "LGPL-3",
"installable": True,
}
178 changes: 178 additions & 0 deletions project_task_resource_type/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_resource_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-26 11:32+0000\n"
"PO-Revision-Date: 2024-11-26 11:32+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_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_needaction
msgid "Action Needed"
msgstr "Nécessite une action"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_attachment_count
msgid "Attachment Count"
msgstr "Nombre de pièces jointes"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__create_uid
msgid "Created by"
msgstr "Crée par"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__create_date
msgid "Created on"
msgstr "Créé le"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__display_name
msgid "Display Name"
msgstr "Nom d'affichage"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_follower_ids
msgid "Followers"
msgstr "Abonnés"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_partner_ids
msgid "Followers (Partners)"
msgstr "Abonnés (Partenaires)"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__has_message
msgid "Has Message"
msgstr "A un message"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__id
msgid "ID"
msgstr ""

#. module: project_task_resource_type
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__message_needaction
msgid "If checked, new messages require your attention."
msgstr "Si coché, de nouveaux messages demandent votre attention."

#. module: project_task_resource_type
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__message_has_error
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr "Si coché, certains messages ont une erreur de livraison."

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_is_follower
msgid "Is Follower"
msgstr "Est un abonné"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_main_attachment_id
msgid "Main Attachment"
msgstr "Pièce jointe principale"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_has_error
msgid "Message Delivery error"
msgstr "Erreur d'envoi du message"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_ids
msgid "Messages"
msgstr ""

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__name
msgid "Name"
msgstr "Nom"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_needaction_counter
msgid "Number of Actions"
msgstr "Nombre d'actions"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_has_error_counter
msgid "Number of errors"
msgstr "Nombre d'erreurs"

#. module: project_task_resource_type
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__message_needaction_counter
msgid "Number of messages requiring action"
msgstr "Nombre de messages nécessitant une action"

#. module: project_task_resource_type
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__message_has_error_counter
msgid "Number of messages with delivery error"
msgstr "Nombre de messages avec des erreurs d'envoi"

#. module: project_task_resource_type
#: model:ir.model,name:project_task_resource_type.model_project_resource
msgid "Project Resource"
msgstr ""

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_task__resource_id
msgid "Resource"
msgstr "Ressource"

#. module: project_task_resource_type
#: model:ir.actions.act_window,name:project_task_resource_type.action_project_resource
msgid "Resources"
msgstr "Ressources"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__message_has_sms_error
msgid "SMS Delivery error"
msgstr "Erreur d'envoi SMS"

#. module: project_task_resource_type
#: model:ir.model,name:project_task_resource_type.model_project_task
msgid "Task"
msgstr "Tâche"

#. module: project_task_resource_type
#: model_terms:ir.ui.view,arch_db:project_task_resource_type.project_resource_form
msgid "Task Resource"
msgstr "Ressource de tâche"

#. module: project_task_resource_type
#: model:ir.ui.menu,name:project_task_resource_type.task_resources
#: model_terms:ir.ui.view,arch_db:project_task_resource_type.project_resource_tree
msgid "Task Resources"
msgstr "Ressources de tâches"

#. module: project_task_resource_type
#: model:ir.model.fields,field_description:project_task_resource_type.field_project_resource__website_message_ids
msgid "Website Messages"
msgstr "Messages du site web"

#. module: project_task_resource_type
#: model:ir.model.fields,help:project_task_resource_type.field_project_resource__website_message_ids
msgid "Website communication history"
msgstr "Historique de communication du site web"
5 changes: 5 additions & 0 deletions project_task_resource_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 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 project_resource

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

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_task_resource_type/models/__init__.py#L4

'.project_resource' imported but unused (F401)
from . import project_task

Check notice on line 5 in project_task_resource_type/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_task_resource_type/models/__init__.py#L5

'.project_task' imported but unused (F401)
12 changes: 12 additions & 0 deletions project_task_resource_type/models/project_resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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 models, fields


class ProjectResource(models.Model):
_name = "project.resource"
_inherit = ["mail.thread"]
_description = "Project Resource"

name = fields.Char(string="Name")
10 changes: 10 additions & 0 deletions project_task_resource_type/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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 models, fields


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

resource_id = fields.Many2one("project.resource")
3 changes: 3 additions & 0 deletions project_task_resource_type/security/ir.model.access.csv
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_resource,access_project_resource,model_project_resource,base.group_user,1,0,0,0
access_project_resource_admin,access_project_resource,model_project_resource,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.
43 changes: 43 additions & 0 deletions project_task_resource_type/views/project_resource_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="project_resource_form" model="ir.ui.view">
<field name="model">project.resource</field>
<field name="arch" type="xml">
<form string="Task Resource">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name"/>
</h1>
</div>
</sheet>
</form>
</field>
</record>

<record id="project_resource_tree" model="ir.ui.view">
<field name="model">project.resource</field>
<field name="arch" type="xml">
<tree string="Task Resources">
<field name="name"/>
</tree>
</field>
</record>

<record id="action_project_resource" model="ir.actions.act_window">
<field name="name">Resources</field>
<field name="res_model">project.resource</field>
<field name="view_mode">tree,form</field>
</record>

<menuitem
name="Task Resources"
id="task_resources"
parent="project.menu_project_config"
action="action_project_resource"
sequence="2"
/>

</odoo>
25 changes: 25 additions & 0 deletions project_task_resource_type/views/project_task_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="view_task_form2" model="ir.ui.view">
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<field name="date_deadline" position="after">
<field name="resource_id"/>
</field>
</field>
</record>

<record id="view_task_search_form" model="ir.ui.view">
<field name="name">Task Search: allow to search by resource</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_search_form"/>
<field name="arch" type="xml">
<field name="stage_id" position="after">
<field name="resource_id"/>
</field>
</field>
</record>

</odoo>
Loading