Skip to content

Commit

Permalink
[ADD] helpdesk_mgmt_templates: add module
Browse files Browse the repository at this point in the history
  • Loading branch information
dessanhemrayev committed Aug 5, 2024
1 parent 7e7873e commit 9392f29
Show file tree
Hide file tree
Showing 17 changed files with 729 additions and 0 deletions.
102 changes: 102 additions & 0 deletions helpdesk_mgmt_templates/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
=============================
Helpdesk Management Templates
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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_templates
: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_templates
: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 record
- In the Template field pre-define the ticket's description that will be triggered based on the category selected

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_templates%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_templates>`_ 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_templates/__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
14 changes: 14 additions & 0 deletions helpdesk_mgmt_templates/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Helpdesk Management Templates",
"summary": "Create Helpdesk Ticket Templates",
"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_category_views.xml"],
"application": False,
}
5 changes: 5 additions & 0 deletions helpdesk_mgmt_templates/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
29 changes: 29 additions & 0 deletions helpdesk_mgmt_templates/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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")

@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 21 in helpdesk_mgmt_templates/models/helpdesk_ticket.py

View check run for this annotation

Codecov / codecov/patch

helpdesk_mgmt_templates/models/helpdesk_ticket.py#L21

Added line #L21 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_templates/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)
5 changes: 5 additions & 0 deletions helpdesk_mgmt_templates/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**To Configure Ticket's Description Template:**

- Go to Helpdesk -> Configuration -> Categories
- Create a New Category or select an existing record
- In the Template field pre-define the ticket's description that will be triggered based on the category selected
5 changes: 5 additions & 0 deletions helpdesk_mgmt_templates/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_templates/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_templates/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 9392f29

Please sign in to comment.