3 Commits

Author SHA1 Message Date
Stéphan Sainléger
cd47dab34a [NEW] helpdesk_portal_ticket_priority_form: create add-on 2024-10-03 23:54:51 +02:00
Stéphan Sainléger
826d242023 [NEW] helpdesk_portal_ticket_enriched_description_form: create add-on 2024-10-03 23:54:11 +02:00
Stéphan Sainléger
b74fdb9b6c [NEW] helpdesk_request_type: create add-ons 2024-10-03 23:54:02 +02:00
28 changed files with 191 additions and 387 deletions

View File

@@ -1,2 +0,0 @@
*.*~
*pyc

View File

@@ -1,53 +0,0 @@
================================
helpdesk_create_task_from_ticket
================================
This module changes the behavior of the buttons "create" and "create and edit" of the field `task` in a ticket form.
It automatically fills up these tasks fields
```
Ticket (helpdesk.ticke) / Tâche (project.task)
Intitulé (name) --> Titre (name)
Utilisateur assigné (user_id) --> Assignés (user_ids)
Projet (project_id) --> Projet (project_id)
Contact (partner_id) --> Client (partner_id)
Catégorie (category_id) --> service (service_id)
Request Type (request_type_id) --> Type de demande (request_type_id)
Priorité (priority) --> Priorité (priority)
```
# Installation
Use Odoo normal module installation procedure to install
`helpdesk_create_task_from_ticket`.
# Known issues / Roadmap
A current limitation is that one task can be linked to many tickets.
Thus, the above task fields are filled up at the creation of the task from a ticket form
but are not updated when the linked tickets are updated.
# Bug Tracker
Bugs are tracked on `our issues website <https://github.com/elabore-coop/helpdesk-tools/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.
# Credits
## Contributors
- Quentin Mondot
## Funders
The development of this module has been financially supported by:
- Elabore (https://elabore.coop)
## Maintainer
This module is maintained by Elabore.

View File

@@ -1 +0,0 @@
from . import models

View File

@@ -1,26 +0,0 @@
# Copyright 2024 Quentin Mondot
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "helpdesk_create_task_from_ticket",
"version": "16.0.1.0.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Quentin Mondot",
"license": "AGPL-3",
"category": "Tools",
"summary": "This module enriches task information when creating it from a ticket form.",
"depends": [
"base",
"helpdesk_mgmt",
"helpdesk_mgmt_project",
"helpdesk_request_type", # to create the helpdesk.request.type model and have the field request_type_id in the helpdesk.ticket model
"project_request_data", # to have the fields service_id and request_type_id in the project.task model
"project_task_add_very_high" # to have priority values 2 and 3 on tasks
],
"data": [
"views/helpdesk_create_task_from_ticket.xml",
],
"installable": True,
"auto_install": False,
"application": False,
}

View File

@@ -1 +0,0 @@
from . import project_task

View File

@@ -1,71 +0,0 @@
from odoo import models, api
class ProjectTask(models.Model):
"""
The function "create" is overloaded to adapt the field "user_ids" from the context of helpdesk.ticket to the one of project.task
This function is called when the user clicks on the button "create" in the task field of the ticket form
The function "onchange" is overloaded to adapt the field "user_ids" from the context of helpdesk.ticket to the one of project.task
This function is called when the user clicks on the button "create and modify" in the task field of the ticket form
"""
_inherit = "project.task"
@api.model
def create(self, vals_list):
if all(key in self.env.context for key in (
"default_user_id",
"default_ticket_category_id",
"default_ticket_request_type_id"
)):
user_ids = [self.env.context["default_user_id"]]
task_service_id, request_type_id = self._match_task_service_and_request_type(
ticket_category_id=self.env.context["default_ticket_category_id"],
ticket_request_type_id=self.env.context["default_ticket_request_type_id"]
)
return super(ProjectTask, self.with_context(
default_user_ids=user_ids,
default_service_id=task_service_id,
default_request_type_id=request_type_id
)).create(vals_list)
return super(ProjectTask, self).create(vals_list)
def onchange(self, values, field_name, field_onchange):
if all(key in self.env.context for key in (
"default_user_id",
"default_ticket_category_id",
"default_ticket_request_type_id"
)):
user_ids = [self.env.context["default_user_id"]]
task_service_id, request_type_id = self._match_task_service_and_request_type(
ticket_category_id=self.env.context["default_ticket_category_id"],
ticket_request_type_id=self.env.context["default_ticket_request_type_id"]
)
return super(ProjectTask, self.with_context(
default_user_ids=user_ids,
default_service_id=task_service_id,
default_request_type_id=request_type_id
)).onchange(values, field_name, field_onchange)
return super(ProjectTask, self).onchange(values, field_name, field_onchange)
def _match_task_service_and_request_type(
self,
ticket_category_id: int,
ticket_request_type_id: int
) -> tuple[int, int]:
helpdesk_ticket_category = self.env["helpdesk.ticket.category"].search(
[("id", "=", ticket_category_id)],
limit=1
)
task_service = self.env["task.service"].search([("name", "=", helpdesk_ticket_category.name)])
helpdesk_ticket_request_type = self.env["helpdesk.request.type"].search(
[("id", "=", ticket_request_type_id)],
limit=1
)
task_request_type = self.env["request.type"].search([("name", "=", helpdesk_ticket_request_type.name)])
return task_service.id, task_request_type.id

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="ticket_view_form_create_task_from_ticket" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.task.from.ticket</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt_project.ticket_view_form" />
<field name="priority" eval="99" />
<field name="arch" type="xml">
<xpath expr="//field[@name='task_id'][2]" position="attributes">
<attribute name="context">
{
'default_project_id': project_id,
'default_user_id': user_id,
'default_partner_id': partner_id,
'default_ticket_category_id': category_id,
'default_ticket_request_type_id': request_type_id,
'default_priority': priority
}
</attribute>
</xpath>
</field>
</record>
</odoo>

View File

@@ -3,7 +3,7 @@
{ {
"name": "helpdesk_portal_ticket_enriched_description_form", "name": "helpdesk_portal_ticket_enriched_description_form",
"version": "16.0.1.0.0", "version": "14.0.1.1.0",
"author": "Elabore", "author": "Elabore",
"website": "https://elabore.coop", "website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger", "maintainer": "Stéphan Sainléger",

View File

@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import main from . import main

View File

@@ -3,7 +3,7 @@
{ {
"name": "helpdesk_portal_ticket_priority_form", "name": "helpdesk_portal_ticket_priority_form",
"version": "16.0.1.0.0", "version": "14.0.1.1.0",
"author": "Elabore", "author": "Elabore",
"website": "https://elabore.coop", "website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger", "maintainer": "Stéphan Sainléger",

View File

@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import main from . import main

View File

@@ -3,7 +3,7 @@
{ {
"name": "helpdesk_request_type", "name": "helpdesk_request_type",
"version": "16.0.1.0.0", "version": "14.0.1.0.0",
"author": "Elabore", "author": "Elabore",
"website": "https://elabore.coop", "website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger", "maintainer": "Stéphan Sainléger",

View File

@@ -1,13 +1,18 @@
import odoo.http as http import odoo.http as http
from odoo.addons.helpdesk_mgmt.controllers.main import HelpdeskTicketController from odoo.addons.helpdesk_mgmt.controllers.main import HelpdeskTicketController
class HelpdeskTicketControllerRequestType(HelpdeskTicketController): class HelpdeskTicketControllerRequestType(HelpdeskTicketController):
def _get_ticket_request_types(self):
types = []
for type in http.request.env["helpdesk.request.type"].search([]):
types.append({"id": type.id, "name": type.name})
return types
@http.route("/new/ticket", type="http", auth="user", website=True) @http.route("/new/ticket", type="http", auth="user", website=True)
def create_new_ticket(self, **kw): def create_new_ticket(self, **kw):
res = super(HelpdeskTicketControllerRequestType, self).create_new_ticket(**kw) res = super(HelpdeskTicketControllerRequestType, self).create_new_ticket(**kw)
request_types = http.request.env["helpdesk.request.type"].search([]) res.qcontext["request_types"] = self._get_ticket_request_types()
res.qcontext["request_types"] = request_types
return res return res
def _prepare_submit_ticket_vals(self, **kw): def _prepare_submit_ticket_vals(self, **kw):
@@ -16,4 +21,4 @@ class HelpdeskTicketControllerRequestType(HelpdeskTicketController):
int(kw.get("request_type")) int(kw.get("request_type"))
) )
res.update({"request_type_id": request_type.id}) res.update({"request_type_id": request_type.id})
return res return res

View File

@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_request_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-03 21:46+0000\n"
"PO-Revision-Date: 2024-10-03 21:46+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: helpdesk_request_type
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.portal_helpdesk_ticket_request_type
msgid "<strong>Request type:</strong>"
msgstr "<strong>Type de requête :</strong>"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__create_date
msgid "Created on"
msgstr "Créé le"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__display_name
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__display_name
msgid "Display Name"
msgstr "Intitulé"
#. module: helpdesk_request_type
#: model:ir.model,name:helpdesk_request_type.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr "Ticket d'assistance"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__id
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__id
msgid "ID"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type____last_update
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: helpdesk_request_type
#: model:ir.model,name:helpdesk_request_type.model_helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__request_type_id
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.portal_create_ticket_request-type
msgid "Request Type"
msgstr "Type de requête"
#. module: helpdesk_request_type
#: model:ir.actions.act_window,name:helpdesk_request_type.act_helpdesk_request_types_list
#: model:ir.ui.menu,name:helpdesk_request_type.menu_helpdesk_request_types
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.helpdesk_request_type_view_tree
msgid "Request Types"
msgstr "Types de requête"
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__sequence
msgid "Sequence"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__name
msgid "name"
msgstr "nom"

View File

@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_request_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-03 21:43+0000\n"
"PO-Revision-Date: 2024-10-03 21:43+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: helpdesk_request_type
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.portal_helpdesk_ticket_request_type
msgid "<strong>Request type:</strong>"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__create_uid
msgid "Created by"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__create_date
msgid "Created on"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__display_name
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__display_name
msgid "Display Name"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model,name:helpdesk_request_type.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__id
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__id
msgid "ID"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type____last_update
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket____last_update
msgid "Last Modified on"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__write_uid
msgid "Last Updated by"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__write_date
msgid "Last Updated on"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model,name:helpdesk_request_type.model_helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_ticket__request_type_id
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.portal_create_ticket_request-type
msgid "Request Type"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.actions.act_window,name:helpdesk_request_type.act_helpdesk_request_types_list
#: model:ir.ui.menu,name:helpdesk_request_type.menu_helpdesk_request_types
#: model_terms:ir.ui.view,arch_db:helpdesk_request_type.helpdesk_request_type_view_tree
msgid "Request Types"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__sequence
msgid "Sequence"
msgstr ""
#. module: helpdesk_request_type
#: model:ir.model.fields,field_description:helpdesk_request_type.field_helpdesk_request_type__name
msgid "name"
msgstr ""

View File

@@ -27,8 +27,8 @@
required="True" required="True"
> >
<t t-foreach="request_types" t-as="type"> <t t-foreach="request_types" t-as="type">
<option t-attf-value="#{type.id}"> <option t-attf-value="#{type['id']}">
<t t-esc="type.name" /> <t t-esc="type['name']" />
</option> </option>
</t> </t>
</select> </select>

View File

@@ -1,2 +0,0 @@
*.*~
*pyc

View File

@@ -1,46 +0,0 @@
=================================
helpdesk_user_default_ticket_team
=================================
Automate ticket team attribution when ticket created by portal user.
- configure default team on portal user form view
- assign automatically the new tickets to the team configured in the user's profile.
Installation
============
Use Odoo normal module installation procedure to install
``helpdesk_user_default_ticket_team``.
Known issues / Roadmap
======================
None yet.
Bug Tracker
===========
Bugs are tracked on `our issues website <https://github.com/elabore-coop/helpdesk-tools/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.
Credits
=======
Contributors
------------
* Stéphan Sainléger
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by Elabore.

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,36 +0,0 @@
# Copyright 2022 Stéphan Sainléger (Elabore)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "helpdesk_user_default_ticket_team",
"version": "16.0.1.1.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger",
"license": "AGPL-3",
"category": "Tools",
"summary": "Automate ticket team attribution when ticket created by portal user.",
# any module necessary for this one to work correctly
"depends": [
"base",
"helpdesk_mgmt",
"helpdesk_mgmt_project",
],
"qweb": [],
"external_dependencies": {
"python": [],
},
# always loaded
"data": [
"views/res_users_views.xml",
],
# only loaded in demonstration mode
"demo": [],
"js": [],
"css": [],
"installable": True,
# Install this module automatically if all dependency have been previously
# and independently installed. Used for synergetic or glue modules.
"auto_install": False,
"application": False,
}

View File

@@ -1 +0,0 @@
This directory should contain the *.po for Odoo translation.

View File

@@ -1,31 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_user_default_ticket_team
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-21 14:37+0000\n"
"PO-Revision-Date: 2025-05-21 16:39+0200\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: helpdesk_user_default_ticket_team
#: model:ir.model.fields,field_description:helpdesk_user_default_ticket_team.field_res_users__default_helpdesk_ticket_team_id
msgid "Default Helpdesk Team"
msgstr "Équipe d'assistance par défaut"
#. module: helpdesk_user_default_ticket_team
#: model:ir.model,name:helpdesk_user_default_ticket_team.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr "Ticket d'assistance"
#. module: helpdesk_user_default_ticket_team
#: model:ir.model,name:helpdesk_user_default_ticket_team.model_res_users
msgid "User"
msgstr "Utilisateur"

View File

@@ -1,31 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * helpdesk_user_default_ticket_team
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-21 14:36+0000\n"
"PO-Revision-Date: 2025-05-21 14:36+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: helpdesk_user_default_ticket_team
#: model:ir.model.fields,field_description:helpdesk_user_default_ticket_team.field_res_users__default_helpdesk_ticket_team_id
msgid "Default Helpdesk Team"
msgstr ""
#. module: helpdesk_user_default_ticket_team
#: model:ir.model,name:helpdesk_user_default_ticket_team.model_helpdesk_ticket
msgid "Helpdesk Ticket"
msgstr ""
#. module: helpdesk_user_default_ticket_team
#: model:ir.model,name:helpdesk_user_default_ticket_team.model_res_users
msgid "User"
msgstr ""

View File

@@ -1,2 +0,0 @@
from . import res_users
from . import helpdesk_ticket

View File

@@ -1,29 +0,0 @@
from odoo import api, fields, models, tools
class HelpdeskTicket(models.Model):
_inherit = "helpdesk.ticket"
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if not vals.get("team_id") and vals.get("partner_id"):
# Find the user who creates the ticket
partner = self.env["res.partner"].browse(vals.get("partner_id"))
if not partner:
continue
user = self.env["res.users"].browse(partner.user_ids[0].id)
if not user:
continue
# Get its default team_id
team = user.default_helpdesk_ticket_team_id
if not team:
continue
vals["team_id"] = team.id
# Set the linked project
if team.default_project_id:
vals["project_id"] = team.default_project_id.id
return super().create(vals_list)

View File

@@ -1,6 +0,0 @@
from odoo import _, api, fields, models
class Users(models.Model):
_inherit = "res.users"
default_helpdesk_ticket_team_id = fields.Many2one('helpdesk.ticket.team', string='Default Helpdesk Team')

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_users_form_inherit_default_helpdesk_team" model="ir.ui.view">
<field name="name">view.users.form.inherit.default.helpdesk.team</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='preferences']" position="inside">
<group name="helpdesk_user_default">
<field name="default_helpdesk_ticket_team_id" />
</group>
</xpath>
</field>
</record>
</odoo>