Skip to content

Commit

Permalink
[MIG] helpdesk_mgmt: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Dec 2, 2024
1 parent 3602d74 commit 73b86d5
Show file tree
Hide file tree
Showing 17 changed files with 313 additions and 341 deletions.
92 changes: 46 additions & 46 deletions helpdesk_mgmt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Helpdesk Management
: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/17.0/helpdesk_mgmt
:target: https://github.com/OCA/helpdesk/tree/18.0/helpdesk_mgmt
:alt: OCA/helpdesk
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/helpdesk-17-0/helpdesk-17-0-helpdesk_mgmt
:target: https://translation.odoo-community.org/projects/helpdesk-18-0/helpdesk-18-0-helpdesk_mgmt
: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=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -125,11 +125,11 @@ permissions set in Helpdesk.
not assigned to any team nor user.
3. *User*: User is able to see all the tickets.

.. |image1| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Channels.PNG
.. |image2| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Categories.PNG
.. |image3| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Stages.PNG
.. |image4| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Teams.PNG
.. |image5| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tags.PNG
.. |image1| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Channels.PNG
.. |image2| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Categories.PNG
.. |image3| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Stages.PNG
.. |image4| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Teams.PNG
.. |image5| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Tags.PNG

Usage
=====
Expand All @@ -156,25 +156,25 @@ To create a new ticket from the kanban view:

|Tickets01|

.. |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
.. |Tickets_Kanban| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG
.. |Tickets01| image:: https://raw.githubusercontent.com/OCA/helpdesk/18.0/helpdesk_mgmt/static/description/Tickets01.PNG

Known issues / Roadmap
======================

- Add a tour feature similar to what the ``project`` module defines to
discover projects / tasks.
- Update portal tests defined in ``tests/test_portal.py`` to rely on
tour specs (in JS) in order to replicate the navigation behavior of
portal users.
- Add a tour feature similar to what the ``project`` module defines to
discover projects / tasks.
- Update portal tests defined in ``tests/test_portal.py`` to rely on
tour specs (in JS) in order to replicate the navigation behavior of
portal users.

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%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt%0Aversion:%2018.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.

Expand All @@ -195,54 +195,54 @@ Authors
Contributors
------------

- `Domatix <https://www.domatix.com>`__:
- `Domatix <https://www.domatix.com>`__:

- Carlos Martínez
- Catalin Airimitoaie
- Álvaro López
- Samuel Calvo
- Carlos Martínez
- Catalin Airimitoaie
- Álvaro López
- Samuel Calvo

- `Adaptive City <https://www.adaptivecity.com>`__:
- `Adaptive City <https://www.adaptivecity.com>`__:

- Aitor Bouzas
- Aitor Bouzas

- `SDi Soluciones, S.L. <https://www.sdi.es>`__:
- `SDi Soluciones, S.L. <https://www.sdi.es>`__:

- Oscar Soto
- Jorge Luis Quinteros
- Oscar Soto
- Jorge Luis Quinteros

- `C2i Change 2 improve <http://www.c2i.es>`__:
- `C2i Change 2 improve <http://www.c2i.es>`__:

- Eduardo Magdalena <[email protected]>
- Eduardo Magdalena <[email protected]>

- `Factor Libre <https://factorlibre.com>`__:
- `Factor Libre <https://factorlibre.com>`__:

- María Alhambra
- Daniel Cano
- María Alhambra
- Daniel Cano

- `Tecnativa <https://www.tecnativa.com>`__:
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Víctor Martínez
- Carolina Fernandez
- Carlos Roca
- Pedro M. Baeza
- Víctor Martínez
- Carolina Fernandez
- Carlos Roca

- `ID42 Sistemas <https://www.id42.com.br>`__:
- `ID42 Sistemas <https://www.id42.com.br>`__:

- Marcel Savegnago
- Eduardo Aparício
- Marcel Savegnago
- Eduardo Aparício

- `Obertix <https://www.obertix.net>`__:
- `Obertix <https://www.obertix.net>`__:

- Vicent Cubells
- Vicent Cubells

- `Solvos <https://www.solvos.es>`__:
- `Solvos <https://www.solvos.es>`__:

- David Alonso
- David Alonso

- `XCG Consulting <https://xcg-consulting.fr>`__:
- `XCG Consulting <https://xcg-consulting.fr>`__:

- Houzéfa Abbasbhay
- Houzéfa Abbasbhay

Maintainers
-----------
Expand All @@ -257,6 +257,6 @@ 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/17.0/helpdesk_mgmt>`_ project on GitHub.
This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/18.0/helpdesk_mgmt>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions 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": "17.0.1.0.1",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"category": "After-Sales",
"author": "AdaptiveCity, "
Expand Down Expand Up @@ -36,7 +36,7 @@
"demo": ["demo/helpdesk_demo.xml"],
"assets": {
"web.assets_frontend": [
"helpdesk_mgmt/static/src/js/new_ticket.js",
"helpdesk_mgmt/static/src/js/new_ticket.esm.js",
],
},
"development_status": "Beta",
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ def submit_ticket(self, **kw):
"res_id": new_ticket.id,
}
)
return werkzeug.utils.redirect("/my/ticket/%s" % new_ticket.id)
return werkzeug.utils.redirect(f"/my/ticket/{new_ticket.id}")
4 changes: 2 additions & 2 deletions helpdesk_mgmt/controllers/myaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _prepare_home_portal_values(self, counters):
helpdesk_model = request.env["helpdesk.ticket"]
ticket_count = (
helpdesk_model.search_count([])
if helpdesk_model.check_access_rights("read", raise_exception=False)
if helpdesk_model.check_access("read", raise_exception=False)
else 0
)
values["ticket_count"] = ticket_count
Expand All @@ -50,7 +50,7 @@ def portal_my_tickets(
):
HelpdeskTicket = request.env["helpdesk.ticket"]
# Avoid error if the user does not have access.
if not HelpdeskTicket.check_access_rights("read", raise_exception=False):
if not HelpdeskTicket.check_access("read", raise_exception=False):
return request.redirect("/my")

values = self._prepare_portal_layout_values()
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _prepare_ticket_number(self, values):
def _compute_access_url(self):
res = super()._compute_access_url()
for item in self:
item.access_url = "/my/ticket/%s" % (item.id)
item.access_url = f"/my/ticket/{item.id}"
return res

# ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_mgmt/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _compute_helpdesk_ticket_count(self):
def action_view_helpdesk_tickets(self):
return {
"name": self.name,
"view_mode": "tree,form",
"view_mode": "list,form",
"res_model": "helpdesk.ticket",
"type": "ir.actions.act_window",
"domain": [("partner_id", "child_of", self.id)],
Expand Down
20 changes: 10 additions & 10 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:36a7b30fb064ac9da0f6450de834e1985c06233fbf0fb071bc554c3b5dc0ec75
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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><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/18.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-18-0/helpdesk-18-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=18.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 @@ -413,7 +413,7 @@ <h2><a class="toc-backref" href="#toc-entry-2">Channels</a></h2>
<li>Set the name for the channel.</li>
<li>You can also Activate or Deactivate channels.</li>
</ol>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Channels.PNG" /></p>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -424,7 +424,7 @@ <h2><a class="toc-backref" href="#toc-entry-3">Categories</a></h2>
<li>Set the name for the category.</li>
<li>You can also Activate or Deactivate categories.</li>
</ol>
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Categories.PNG" /></p>
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -441,7 +441,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Stages</a></h2>
<li>You can add a description for the stage.</li>
<li>You can also Activate or Deactivate stages.</li>
</ol>
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Stages.PNG" /></p>
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -454,7 +454,7 @@ <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>
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Teams.PNG" /></p>
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -466,7 +466,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Tags</a></h2>
<li>Set the color index for the tag.</li>
<li>You can also Activate or Deactivate tags.</li>
</ol>
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tags.PNG" /></p>
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -491,7 +491,7 @@ <h1><a class="toc-backref" href="#toc-entry-8">Usage</a></h1>
<li>In the Kanban view, click in the kanban card of a team to see their
tickets and create new ones.</li>
</ol>
<p><img alt="Tickets_Kanban" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets_Kanban.PNG" /></p>
<p><img alt="Tickets_Kanban" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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
Expand All @@ -505,7 +505,7 @@ <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>
<p><img alt="Tickets01" src="https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tickets01.PNG" /></p>
<p><img alt="Tickets01" src="https://raw.githubusercontent.com/OCA/helpdesk/18.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>
Expand All @@ -522,7 +522,7 @@ <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:%2017.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:%2018.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 @@ -602,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/17.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/18.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
41 changes: 41 additions & 0 deletions helpdesk_mgmt/static/src/js/new_ticket.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {_t} from "@web/core/l10n/translation";
import publicWidget from "@web/legacy/js/public/public_widget";

publicWidget.registry.NewTicket = publicWidget.Widget.extend({
selector: "form[action='/submitted/ticket']",
events: Object.assign(
{},
{
'change input[name="attachment"]': "_onChangeAttachment",
}
),
init() {
this._super(...arguments);
this.notification = this.bindService("notification");
},
_onChangeAttachment(ev) {
ev.preventDefault();
// eslint-disable-next-line no-undef
const attachment_input = document.getElementById("attachment");
const max_upload_size = attachment_input.getAttribute("max_upload_size");
// eslint-disable-next-line no-undef
const dt = new DataTransfer();
for (const file of attachment_input.files) {
if (file.size > max_upload_size) {
var message = `${file.name} file exceed the maximum file size of ${this.humanSize(max_upload_size)}.`;
this.notification.add(_t(message), {type: "danger"});
} else {
dt.items.add(file);
}
}
attachment_input.files = dt.files;
},

humanSize(bytes) {
if (bytes === 0) return "0 Bytes";
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
const i = Math.floor(Math.log(bytes) / Math.log(1024));
const size = bytes / Math.pow(1024, i);
return `${size.toFixed(2)} ${sizes[i]}`;
},
});
Loading

0 comments on commit 73b86d5

Please sign in to comment.