Skip to content

Commit

Permalink
[MIG] helpdesk_mgmt: Migration to 17.0
Browse files Browse the repository at this point in the history
Co-authored-by: Chandni Prajapati Khamar <[email protected]>
  • Loading branch information
giarve and chandni-serpentcs committed Nov 8, 2024
1 parent 6943af6 commit d1e4683
Show file tree
Hide file tree
Showing 20 changed files with 150 additions and 211 deletions.
8 changes: 4 additions & 4 deletions helpdesk_mgmt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Usage
2. In the Kanban view, click in the kanban card of a team to see their
tickets and create new ones.

|image1|
|Tickets_Kanban|

To create a new ticket from the kanban view:

Expand All @@ -154,10 +154,10 @@ To create a new ticket from the kanban view:
8. Add a description.
9. You can also attach files to the ticket.

|image2|
|Tickets01|

.. |image1| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG
.. |image2| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets01.PNG
.. |Tickets_Kanban| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG
.. |Tickets01| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets01.PNG

Known issues / Roadmap
======================
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Helpdesk Management",
"summary": """
Helpdesk""",
"version": "16.0.2.6.2",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "After-Sales",
"author": "AdaptiveCity, "
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/controllers/myaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ def _ticket_get_order(self, order, groupby):
field_name = groupby_mapping.get(groupby, "")
if not field_name:
return order
return "%s, %s" % (field_name, order)
return f"{field_name}, {order}"
1 change: 0 additions & 1 deletion helpdesk_mgmt/data/helpdesk_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
<record id="mail_alias_lead_info_helpdesk" model="mail.alias">
<field name="alias_name">help</field>
<field name="alias_model_id" ref="model_helpdesk_ticket" />
<field name="alias_user_id" ref="base.user_admin" />
<field name="alias_parent_model_id" ref="model_helpdesk_ticket_team" />
</record>
<!-- Helpdesk Ticket-related subtypes for messaging / Chatter -->
Expand Down
20 changes: 8 additions & 12 deletions helpdesk_mgmt/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def _read_group_stage_ids(self, stages, domain, order):
("id", "in", stages.ids),
("team_ids", "=", False),
]
default_team_id = self.default_get(["team_id"]).get("team_id")
default_team_id = self.default_get(["team_id"])
if default_team_id:
search_domain = [
"|",
("team_ids", "=", default_team_id),
("team_ids", "=", default_team_id["team_id"]),
] + search_domain
return stages.search(search_domain, order=order)

Expand All @@ -46,10 +46,7 @@ def _read_group_stage_ids(self, stages, domain, order):
string="Assigned user",
tracking=True,
index=True,
compute="_compute_user_id",
store=True,
readonly=False,
domain="team_id and [('share', '=', False),('id', 'in', user_ids)] or [('share', '=', False)]", # noqa: B950
domain="team_id and [('share', '=', False),('id', 'in', user_ids)] or [('share', '=', False)]", # noqa: B950,E501
)
user_ids = fields.Many2many(
comodel_name="res.users", related="team_id.user_ids", string="Users"
Expand Down Expand Up @@ -132,11 +129,10 @@ def _read_group_stage_ids(self, stages, domain, order):
)
active = fields.Boolean(default=True)

def name_get(self):
res = []
for rec in self:
res.append((rec.id, rec.number + " - " + rec.name))
return res
@api.depends("name")
def _compute_display_name(self):
for ticket in self:
ticket.display_name = f"{ticket.number} - {ticket.name}"

def assign_to_me(self):
self.write({"user_id": self.env.user.id})
Expand Down Expand Up @@ -217,7 +213,7 @@ def _track_template(self, tracking):
{
# Need to set mass_mail so that the email will always be sent
"composition_mode": "mass_mail",
"auto_delete_message": True,
"auto_delete_keep_log": False,
"subtype_id": self.env["ir.model.data"]._xmlid_to_res_id(
"mail.mt_note"
),
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ class IrHttp(models.AbstractModel):

@classmethod
def _get_translation_frontend_modules_name(cls):
mods = super(IrHttp, cls)._get_translation_frontend_modules_name()
mods = super()._get_translation_frontend_modules_name()
return mods + ["helpdesk_mgmt"]
4 changes: 2 additions & 2 deletions helpdesk_mgmt/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
2. In the Kanban view, click in the kanban card of a team to see their
tickets and create new ones.

![](../static/description/Tickets_Kanban.PNG)
![Tickets_Kanban](../static/description/Tickets_Kanban.PNG)

To create a new ticket from the kanban view:

Expand All @@ -18,4 +18,4 @@ To create a new ticket from the kanban view:
8. Add a description.
9. You can also attach files to the ticket.

![](../static/description/Tickets01.PNG)
![Tickets01](../static/description/Tickets01.PNG)
80 changes: 41 additions & 39 deletions helpdesk_mgmt/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Helpdesk Management</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a5c1fe41ebe60837c24f33363511111603fcee2f9387b84bd2fe69aaaafb5938
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt"><img alt="OCA/helpdesk" src="https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_mgmt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/helpdesk/tree/17.0/helpdesk_mgmt"><img alt="OCA/helpdesk" src="https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/helpdesk-17-0/helpdesk-17-0-helpdesk_mgmt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds Helpdesk functionality in Odoo.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -407,44 +407,43 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<div class="section" id="channels">
<h2><a class="toc-backref" href="#toc-entry-2">Channels</a></h2>
<ol class="arabic simple">
<li>Go to <em>Helpdesk &gt; Configuration &gt; Channels</em> to edit or create new channels.</li>
<li>Go to <em>Helpdesk &gt; Configuration &gt; Channels</em> to edit or create new
channels.</li>
<li>Edit or create a channel.</li>
<li>Set the name for the channel.</li>
<li>You can also Activate or Deactivate channels.</li>
</ol>
<div class="figure">
<img alt="Channels" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Channels.PNG" style="width: 600px;" />
</div>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Channels.PNG" /></p>
</div>
<div class="section" id="categories">
<h2><a class="toc-backref" href="#toc-entry-3">Categories</a></h2>
<ol class="arabic simple">
<li>Go to <em>Helpdesk &gt; Configuration &gt; Categories</em> to edit or create new categories.</li>
<li>Go to <em>Helpdesk &gt; Configuration &gt; Categories</em> to edit or create new
categories.</li>
<li>Edit or create a new category.</li>
<li>Set the name for the category.</li>
<li>You can also Activate or Deactivate categories.</li>
</ol>
<div class="figure">
<img alt="Categories" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Categories.PNG" style="width: 600px;" />
</div>
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Categories.PNG" /></p>
</div>
<div class="section" id="stages">
<h2><a class="toc-backref" href="#toc-entry-4">Stages</a></h2>
<ol class="arabic simple">
<li>Go to <em>Helpdesk &gt; Configuration &gt; Stages</em> to edit or create new stages.</li>
<li>Go to <em>Helpdesk &gt; Configuration &gt; Stages</em> to edit or create new
stages.</li>
<li>Edit or create a new stage.</li>
<li>Set the name for the stage.</li>
<li>Set the sequence order for the stage.</li>
<li>You can select an Email template.</li>
<li>Mark the Unattended checkbox if the stage contains unattended tickets.</li>
<li>Mark the Unattended checkbox if the stage contains unattended
tickets.</li>
<li>Mark the Closed checkbox if the stage contains closed tickets.</li>
<li>You can add a description for the stage.</li>
<li>You can also Activate or Deactivate stages.</li>
</ol>
<div class="figure">
<img alt="Stages" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Stages.PNG" style="width: 600px;" />
</div>
<p>You can also sort the stage sequence if you move up or down the stages in the list view.</p>
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Stages.PNG" /></p>
<p>You can also sort the stage sequence if you move up or down the stages
in the list view.</p>
</div>
<div class="section" id="teams">
<h2><a class="toc-backref" href="#toc-entry-5">Teams</a></h2>
Expand All @@ -455,45 +454,48 @@ <h2><a class="toc-backref" href="#toc-entry-5">Teams</a></h2>
<li>Add the teams members.</li>
<li>You can also Activate or Deactivate teams.</li>
</ol>
<div class="figure">
<img alt="Teams" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Teams.PNG" style="width: 600px;" />
</div>
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Teams.PNG" /></p>
</div>
<div class="section" id="tags">
<h2><a class="toc-backref" href="#toc-entry-6">Tags</a></h2>
<ol class="arabic simple">
<li>Go to <em>Helpdesk &gt; Configuration &gt; Ticket Tags</em> to edit or create new tags.</li>
<li>Go to <em>Helpdesk &gt; Configuration &gt; Ticket Tags</em> to edit or create new
tags.</li>
<li>Edit or create a new tag.</li>
<li>Set the name for the tag.</li>
<li>Set the color index for the tag.</li>
<li>You can also Activate or Deactivate tags.</li>
</ol>
<div class="figure">
<img alt="Ticket Tags" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Tags.PNG" style="width: 600px;" />
</div>
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tags.PNG" /></p>
</div>
<div class="section" id="permissions">
<h2><a class="toc-backref" href="#toc-entry-7">Permissions</a></h2>
<p>There are restrictions to read tickets according to the user’s permissions set in Helpdesk.</p>
<p>There are restrictions to read tickets according to the user’s
permissions set in Helpdesk.</p>
<ol class="arabic simple">
<li><em>User: Personal tickets</em>: User is able to see their tickets (those that are assigned to their user) or those that are no team nor user is assigned.</li>
<li><em>User: Team tickets</em>: User is able to see all the tickets that are assigned to the teams to which he/she belongs or the tickets that are not assigned to any team nor user.</li>
<li><em>User: Personal tickets</em>: User is able to see their tickets (those
that are assigned to their user) or those that are no team nor user
is assigned.</li>
<li><em>User: Team tickets</em>: User is able to see all the tickets that are
assigned to the teams to which he/she belongs or the tickets that are
not assigned to any team nor user.</li>
<li><em>User</em>: User is able to see all the tickets.</li>
</ol>
</div>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-8">Usage</a></h1>
<ol class="arabic simple">
<li>Go to <em>Helpdesk</em> or <em>Helpdesk &gt; Dashboard</em> to see the tickets dashboard</li>
<li>In the Kanban view, click in the kanban card of a team to see their tickets and create new ones.</li>
<li>Go to <em>Helpdesk</em> or <em>Helpdesk &gt; Dashboard</em> to see the tickets
dashboard</li>
<li>In the Kanban view, click in the kanban card of a team to see their
tickets and create new ones.</li>
</ol>
<div class="figure">
<img alt="Kanban view" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG" style="width: 600px;" />
</div>
<p><img alt="Tickets_Kanban" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG" /></p>
<p>To create a new ticket from the kanban view:</p>
<ol class="arabic simple">
<li>Press <em>Create</em> button or click on the plus icon at the top of the column of a stage.</li>
<li>Press <em>Create</em> button or click on the plus icon at the top of the
column of a stage.</li>
<li>Set the name or subject for the ticket.</li>
<li>Select the team that will manage the ticket.</li>
<li>You can select a user to assign the ticket.</li>
Expand All @@ -503,24 +505,24 @@ <h1><a class="toc-backref" href="#toc-entry-8">Usage</a></h1>
<li>Add a description.</li>
<li>You can also attach files to the ticket.</li>
</ol>
<div class="figure">
<img alt="Create a new ticket" src="https://raw.githubusercontent.com/OCA/helpdesk/16.0/helpdesk_mgmt/static/description/Tickets01.PNG" style="width: 600px;" />
</div>
<p><img alt="Tickets01" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets01.PNG" /></p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-9">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Add a tour feature similar to what the <tt class="docutils literal">project</tt> module defines to discover projects / tasks.</li>
<li>Update portal tests defined in <tt class="docutils literal">tests/test_portal.py</tt> to rely on tour specs (in JS)
in order to replicate the navigation behavior of portal users.</li>
<li>Add a tour feature similar to what the <tt class="docutils literal">project</tt> module defines to
discover projects / tasks.</li>
<li>Update portal tests defined in <tt class="docutils literal">tests/test_portal.py</tt> to rely on
tour specs (in JS) in order to replicate the navigation behavior of
portal users.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-10">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/helpdesk/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -600,7 +602,7 @@ <h2><a class="toc-backref" href="#toc-entry-14">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt">OCA/helpdesk</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/helpdesk/tree/17.0/helpdesk_mgmt">OCA/helpdesk</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions helpdesk_mgmt/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ def setUpClass(cls):
def _create_ticket(self, team, user=False):
ticket = self.env["helpdesk.ticket"].create(
{
"name": "Ticket %s (%s)"
% (team.name, user.login if user else "unassigned"),
"name": "Ticket {} ({})".format(
team.name, user.login if user else "unassigned"
),
"description": "Description",
"team_id": team.id,
"user_id": user.id if user else False,
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/tests/test_helpdesk_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _create_ticket(self, partner, ticket_title, **values):

def _submit_ticket(self, **values):
data = {
"category": self.env.ref("helpdesk_mgmt.helpdesk_category_1").id,
"category": self.env.ref("helpdesk_mgmt.helpdesk_category_1_demo").id,
"csrf_token": http.Request.csrf_token(self),
"subject": self.new_ticket_title,
"description": "\n".join(self.new_ticket_desc_lines),
Expand Down
4 changes: 2 additions & 2 deletions helpdesk_mgmt/tests/test_helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ def test_helpdesk_ticket_message_new(self):
try:
t = Ticket.message_new(msg_dict)
except Exception as error:
self.fail("%s: %s" % (type(error), error))
self.fail(f"{type(error)}: {error}")
self.assertEqual(t.name, title, "The ticket should have the correct title.")

title = "New title"
update_vals = {"name": title}
try:
t.message_update(msg_dict, update_vals)
except Exception as error:
self.fail("%s: %s" % (type(error), error))
self.fail(f"{type(error)}: {error}")
self.assertEqual(
t.name, title, "The ticket should have the correct (new) title."
)
Expand Down
Loading

0 comments on commit d1e4683

Please sign in to comment.