Skip to content

Commit

Permalink
[ADD] helpdesk_mgmt_template: add module
Browse files Browse the repository at this point in the history
Add pre-configured ticket description templates based on category

This commit introduces the following enhancements:
- Adds the ability to pre-configure a helpdesk ticket's description template based on the selected category.
- Users can now define ticket description templates within Helpdesk-->Configuration-->Categories.
- Categories can be assigned to specific teams, allowing pre-defined templates to be triggered during ticket creation.

Task: 3829
  • Loading branch information
dessanhemrayev committed Oct 23, 2024
1 parent 41e07ff commit aefb026
Show file tree
Hide file tree
Showing 19 changed files with 856 additions and 0 deletions.
106 changes: 106 additions & 0 deletions helpdesk_mgmt_template/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
============================
Helpdesk Management Template
============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d785e09cb190bfcdbafe4d42b6fd30f3bf16f06d6febdb41038241735e093008
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github
:target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt_template
:alt: OCA/helpdesk
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_mgmt_template
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0
:alt: Try me on Runboat

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

The module adds the following features:

- Pre-configure ticket description template based on it's category

**Table of contents**

.. contents::
:local:

Configuration
=============

**To Configure Ticket's Description Template**
- Go to Helpdesk -> Configuration -> Categories.
- Create a new Category or select an existing Category.
- Set the *Template* field with pre-defined the ticket's description that will be triggered based on the category selected.

**To configure available Categories for Teams**
- Go to Helpdesk -> Configuration -> Categories.
- Create a new Team or select an existing Team.
- Select categories which are available for the Team.

Usage
=====

**Go to Helpdesk module:**

- Select a Team
- Open a Ticket
- Create a new Ticket
- Select Category
- Add a description or modify category description template (if configured)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/helpdesk/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt_template%0Aversion:%2016.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
~~~~~~~

* Cetmix OÜ

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

* `Cetmix OÜ <https://cetmix.com>`_:

* Ivan Sokolov
* Mikhail Lapin
* Dessan Hemrayev

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/helpdesk <https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt_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 helpdesk_mgmt_template/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions helpdesk_mgmt_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Helpdesk Management Template",
"summary": "Create Helpdesk Ticket Template",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Cetmix OÜ, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/helpdesk",
"depends": ["helpdesk_mgmt"],
"data": [
"views/helpdesk_ticket_views.xml",
"views/helpdesk_ticket_category_views.xml",
"views/helpdesk_ticket_team_views.xml",
],
"application": False,
}
5 changes: 5 additions & 0 deletions helpdesk_mgmt_template/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import helpdesk_ticket_category
from . import helpdesk_ticket
41 changes: 41 additions & 0 deletions helpdesk_mgmt_template/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import api, fields, models


class HelpdeskTicket(models.Model):
_inherit = "helpdesk.ticket"

description = fields.Html(
store=True,
compute="_compute_description",
readonly=False,
)
helpdesk_ticket_category_ids = fields.Many2many(
"helpdesk.ticket.category", compute="_compute_helpdesk_ticket_category"
)

@api.depends("team_id")
def _compute_helpdesk_ticket_category(self):
for rec in self:
rec.helpdesk_ticket_category_ids = rec.team_id.category_ids

@api.depends("category_id")
def _compute_description(self):
for record in self:
if record.category_id.template_description:
record.description = record.category_id.template_description
elif record.description:
record.description = record.description
else:
record.description = "<p></p>"

Check warning on line 33 in helpdesk_mgmt_template/models/helpdesk_ticket.py

View check run for this annotation

Codecov / codecov/patch

helpdesk_mgmt_template/models/helpdesk_ticket.py#L33

Added line #L33 was not covered by tests

def copy(self, default=None):
self.ensure_one()
if default is None:
default = {}
if "description" not in default:
default["description"] = "<p></p>"
return super().copy(default)
10 changes: 10 additions & 0 deletions helpdesk_mgmt_template/models/helpdesk_ticket_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class HelpdeskCategory(models.Model):
_inherit = "helpdesk.ticket.category"

template_description = fields.Html(sanitize_style=True)
9 changes: 9 additions & 0 deletions helpdesk_mgmt_template/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**To Configure Ticket's Description Template**
- Go to Helpdesk -> Configuration -> Categories.
- Create a new Category or select an existing Category.
- Set the *Template* field with pre-defined the ticket's description that will be triggered based on the category selected.

**To configure available Categories for Teams**
- Go to Helpdesk -> Configuration -> Categories.
- Create a new Team or select an existing Team.
- Select categories which are available for the Team.
5 changes: 5 additions & 0 deletions helpdesk_mgmt_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* `Cetmix OÜ <https://cetmix.com>`_:

* Ivan Sokolov
* Mikhail Lapin
* Dessan Hemrayev
3 changes: 3 additions & 0 deletions helpdesk_mgmt_template/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The module adds the following features:

- Pre-configure ticket description template based on it's category
7 changes: 7 additions & 0 deletions helpdesk_mgmt_template/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**Go to Helpdesk module:**

- Select a Team
- Open a Ticket
- Create a new Ticket
- Select Category
- Add a description or modify category description template (if configured)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit aefb026

Please sign in to comment.