diff --git a/maintenance_helpdesk_mgmt/README.rst b/maintenance_helpdesk_mgmt/README.rst new file mode 100644 index 000000000..88a08d762 --- /dev/null +++ b/maintenance_helpdesk_mgmt/README.rst @@ -0,0 +1,105 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=================================== +Maintenance Request Helpdesk Ticket +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:19dc8fc4b4bf333e75e44e130db1989f6bbc6ecfa4453fba2463eed4db5dd2b3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fmaintenance-lightgray.png?logo=github + :target: https://github.com/OCA/maintenance/tree/19.0/maintenance_helpdesk_mgmt + :alt: OCA/maintenance +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/maintenance-19-0/maintenance-19-0-maintenance_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/maintenance&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to link maintenance requests with helpdesk tickets. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +From Maintenance Requests + +1. Navigate to **Maintenance > Maintenance Requests** +2. Open an existing maintenance request or create a new one +3. In the maintenance request form, you'll find a tab for **Helpdesk + Tickets** +4. Use this tab to link one or more helpdesk tickets to the maintenance + request +5. Select existing tickets or create new ones directly from this + interface + +From Helpdesk Tickets + +1. Navigate to **Helpdesk > Tickets** +2. Open a helpdesk ticket +3. If the ticket is linked to maintenance requests, you'll see a + **Maintenance** smart button in the top-right area +4. Click the smart button to view all linked maintenance requests +5. The button shows the count of associated maintenance requests + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa + +Contributors +------------ + +- Tecnativa + + - Christian Ramos + +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/maintenance `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/maintenance_helpdesk_mgmt/__init__.py b/maintenance_helpdesk_mgmt/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/maintenance_helpdesk_mgmt/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/maintenance_helpdesk_mgmt/__manifest__.py b/maintenance_helpdesk_mgmt/__manifest__.py new file mode 100644 index 000000000..b2bb6006c --- /dev/null +++ b/maintenance_helpdesk_mgmt/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Tecnativa - Christian Ramos +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Maintenance Request Helpdesk Ticket", + "summary": """ + Allows you to link Helpdesk Tickets with maintenance requests""", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/maintenance", + "depends": ["maintenance", "helpdesk_mgmt"], + "data": [ + "views/maintenance_request.xml", + "views/helpdesk_ticket_views.xml", + ], +} diff --git a/maintenance_helpdesk_mgmt/i18n/es.po b/maintenance_helpdesk_mgmt/i18n/es.po new file mode 100644 index 000000000..07b920d87 --- /dev/null +++ b/maintenance_helpdesk_mgmt/i18n/es.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_helpdesk_mgmt +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.9\n" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "Ticket Helpdesk" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_form_button_box +msgid "Helpdesk Tickets" +msgstr "Tickets Helpdesk" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_tickets_count +msgid "Helpdesk Tickets Count" +msgstr "Conteo de Tickets Helpdesk" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_kanban +msgid "Helpdesk tickets" +msgstr "Tickets Helpdesk" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_form_inherit +msgid "Maintenance" +msgstr "Mantenimiento" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_maintenance_request +msgid "Maintenance Request" +msgstr "Solicitud de Mantenimiento" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_kanban +msgid "Maintenance Requests" +msgstr "Solicitudes de Mantenimiento" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_requests_count +msgid "Maintenance Requests Count" +msgstr "Conteo de Solicitudes de Mantenimiento" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_search +msgid "With helpdesk tickets" +msgstr "Con tickets de Helpdesk" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.helpdesk_ticket_view_search +msgid "With maintenance requests" +msgstr "Con solicitudes de mantenimiento" diff --git a/maintenance_helpdesk_mgmt/i18n/fr.po b/maintenance_helpdesk_mgmt/i18n/fr.po new file mode 100644 index 000000000..59909103b --- /dev/null +++ b/maintenance_helpdesk_mgmt/i18n/fr.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_helpdesk_mgmt +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-06-11 14:47+0000\n" +"Last-Translator: Yann Papouin \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "Ticket d'assistance" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_count +msgid "Helpdesk Ticket Count" +msgstr "Nombre de tickets d'assistance" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_form_button_box +msgid "Helpdesk Tickets" +msgstr "Tickets d'assistance" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_kanban +msgid "Helpdesk tickets" +msgstr "Tickets d'assistance" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_form_inherit +msgid "Maintenance" +msgstr "Maintenance" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_maintenance_request +msgid "Maintenance Request" +msgstr "Demande de maintenance" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_count +msgid "Maintenance Request Count" +msgstr "Nombre de demandes de maintenance" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_kanban +msgid "Maintenance Requests" +msgstr "Demandes de maintenance" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_search +msgid "With helpdesk tickets" +msgstr "Avec tickets d'assistance" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.helpdesk_ticket_view_search +msgid "With maintenance requests" +msgstr "Avec demandes de maintenance" diff --git a/maintenance_helpdesk_mgmt/i18n/it.po b/maintenance_helpdesk_mgmt/i18n/it.po new file mode 100644 index 000000000..4b1452383 --- /dev/null +++ b/maintenance_helpdesk_mgmt/i18n/it.po @@ -0,0 +1,72 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_helpdesk_mgmt +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-03-24 11:45+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "Ticket assistenza clienti" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_count +msgid "Helpdesk Ticket Count" +msgstr "Conteggio ticket assistenza clienti" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_form_button_box +msgid "Helpdesk Tickets" +msgstr "Ticket assistenza clienti" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_kanban +msgid "Helpdesk tickets" +msgstr "Ticket assistenza clienti" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_form_inherit +msgid "Maintenance" +msgstr "Manutenzione" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_maintenance_request +msgid "Maintenance Request" +msgstr "Richiesta manutenzione" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_count +msgid "Maintenance Request Count" +msgstr "Conta richiesta manutenzione" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_kanban +msgid "Maintenance Requests" +msgstr "Richieste manutenzione" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_search +msgid "With helpdesk tickets" +msgstr "Con ticket assistenza clienti" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.helpdesk_ticket_view_search +msgid "With maintenance requests" +msgstr "Con richieste di manutenzione" + +#~ msgid "Maintenance Requests Count" +#~ msgstr "Conta richieste manutenzione" diff --git a/maintenance_helpdesk_mgmt/i18n/maintenance_helpdesk_mgmt.pot b/maintenance_helpdesk_mgmt/i18n/maintenance_helpdesk_mgmt.pot new file mode 100644 index 000000000..b51e02022 --- /dev/null +++ b/maintenance_helpdesk_mgmt/i18n/maintenance_helpdesk_mgmt.pot @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_helpdesk_mgmt +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \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: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_count +msgid "Helpdesk Ticket Count" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_form_button_box +msgid "Helpdesk Tickets" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_kanban +msgid "Helpdesk tickets" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_form_inherit +msgid "Maintenance" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_maintenance_request +msgid "Maintenance Request" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_count +msgid "Maintenance Request Count" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_kanban +msgid "Maintenance Requests" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_search +msgid "With helpdesk tickets" +msgstr "" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.helpdesk_ticket_view_search +msgid "With maintenance requests" +msgstr "" diff --git a/maintenance_helpdesk_mgmt/i18n/sl.po b/maintenance_helpdesk_mgmt/i18n/sl.po new file mode 100644 index 000000000..e51e65fa8 --- /dev/null +++ b/maintenance_helpdesk_mgmt/i18n/sl.po @@ -0,0 +1,70 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_helpdesk_mgmt +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-06-26 13:51+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "Zahtevek za podporo" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_count +msgid "Helpdesk Ticket Count" +msgstr "Št. zahtevkov za podporo" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_maintenance_request__helpdesk_ticket_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_form_button_box +msgid "Helpdesk Tickets" +msgstr "Zahtevki za podporo" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_kanban +msgid "Helpdesk tickets" +msgstr "Zahtevki za podporo" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_form_inherit +msgid "Maintenance" +msgstr "Servis" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model,name:maintenance_helpdesk_mgmt.model_maintenance_request +msgid "Maintenance Request" +msgstr "Servisni zahtevek" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_count +msgid "Maintenance Request Count" +msgstr "Št. servisnih zahtevkov" + +#. module: maintenance_helpdesk_mgmt +#: model:ir.model.fields,field_description:maintenance_helpdesk_mgmt.field_helpdesk_ticket__maintenance_request_ids +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.view_helpdesk_ticket_kanban +msgid "Maintenance Requests" +msgstr "Servisni zahtevki" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.hr_equipment_request_view_search +msgid "With helpdesk tickets" +msgstr "Z zahtevki za podporo" + +#. module: maintenance_helpdesk_mgmt +#: model_terms:ir.ui.view,arch_db:maintenance_helpdesk_mgmt.helpdesk_ticket_view_search +msgid "With maintenance requests" +msgstr "S servisnimi zahtevki" diff --git a/maintenance_helpdesk_mgmt/models/__init__.py b/maintenance_helpdesk_mgmt/models/__init__.py new file mode 100644 index 000000000..8db08f9f3 --- /dev/null +++ b/maintenance_helpdesk_mgmt/models/__init__.py @@ -0,0 +1,2 @@ +from . import maintenance_request +from . import helpdesk_ticket diff --git a/maintenance_helpdesk_mgmt/models/helpdesk_ticket.py b/maintenance_helpdesk_mgmt/models/helpdesk_ticket.py new file mode 100644 index 000000000..efd4b9bc3 --- /dev/null +++ b/maintenance_helpdesk_mgmt/models/helpdesk_ticket.py @@ -0,0 +1,46 @@ +# Copyright 2026 Tecnativa - Christian Ramos +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class HelpdeskTicket(models.Model): + _inherit = "helpdesk.ticket" + + maintenance_request_ids = fields.Many2many( + "maintenance.request", + "maintenance_helpdesk_ticket", + "helpdesk_ticket_id", + "maintenance_request_id", + string="Maintenance Requests", + copy=False, + ) + + maintenance_request_count = fields.Integer( + compute="_compute_maintenance_request_count" + ) + + def _compute_maintenance_request_count(self): + group_data = self.env["maintenance.request"]._read_group( + domain=[("helpdesk_ticket_ids", "in", self.ids)], + groupby=["helpdesk_ticket_ids"], + aggregates=["__count"], + ) + mapped_data = { + helpdesk_ticket.id: count for (helpdesk_ticket, count) in group_data + } + for helpdesk_ticket in self: + helpdesk_ticket.maintenance_request_count = mapped_data.get( + helpdesk_ticket.id, 0 + ) + + def action_view_maintenance_request(self): + action = self.env["ir.actions.act_window"]._for_xml_id( + "maintenance.hr_equipment_request_action" + ) + if len(self.maintenance_request_ids) > 1: + action["domain"] = [("id", "in", self.maintenance_request_ids.ids)] + elif self.maintenance_request_ids: + action["views"] = [(False, "form")] + action["res_id"] = self.maintenance_request_ids.id + action["context"] = {} + return action diff --git a/maintenance_helpdesk_mgmt/models/maintenance_request.py b/maintenance_helpdesk_mgmt/models/maintenance_request.py new file mode 100644 index 000000000..1cd0330fd --- /dev/null +++ b/maintenance_helpdesk_mgmt/models/maintenance_request.py @@ -0,0 +1,43 @@ +# Copyright 2026 Tecnativa - Christian Ramos +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class MaintenanceRequest(models.Model): + _inherit = "maintenance.request" + + helpdesk_ticket_ids = fields.Many2many( + "helpdesk.ticket", + "maintenance_helpdesk_ticket", + "maintenance_request_id", + "helpdesk_ticket_id", + string="Helpdesk Tickets", + copy=False, + ) + helpdesk_ticket_count = fields.Integer(compute="_compute_helpdesk_ticket_count") + + def _compute_helpdesk_ticket_count(self): + group_data = self.env["helpdesk.ticket"]._read_group( + domain=[("maintenance_request_ids", "in", self.ids)], + groupby=["maintenance_request_ids"], + aggregates=["__count"], + ) + mapped_data = { + maintenance_request.id: count for (maintenance_request, count) in group_data + } + for maintenance_request in self: + maintenance_request.helpdesk_ticket_count = mapped_data.get( + maintenance_request.id, 0 + ) + + def action_view_helpdesk_tickets(self): + action = self.env["ir.actions.act_window"]._for_xml_id( + "helpdesk_mgmt.helpdesk_ticket_action" + ) + if len(self.helpdesk_ticket_ids) > 1: + action["domain"] = [("id", "in", self.helpdesk_ticket_ids.ids)] + elif self.helpdesk_ticket_ids: + action["views"] = [(False, "form")] + action["res_id"] = self.helpdesk_ticket_ids.id + action["context"] = {} + return action diff --git a/maintenance_helpdesk_mgmt/pyproject.toml b/maintenance_helpdesk_mgmt/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/maintenance_helpdesk_mgmt/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/maintenance_helpdesk_mgmt/readme/CONTRIBUTORS.md b/maintenance_helpdesk_mgmt/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..060fc5f38 --- /dev/null +++ b/maintenance_helpdesk_mgmt/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Tecnativa + - Christian Ramos diff --git a/maintenance_helpdesk_mgmt/readme/DESCRIPTION.md b/maintenance_helpdesk_mgmt/readme/DESCRIPTION.md new file mode 100644 index 000000000..5d4782f94 --- /dev/null +++ b/maintenance_helpdesk_mgmt/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to link maintenance requests with helpdesk tickets. diff --git a/maintenance_helpdesk_mgmt/readme/USAGE.md b/maintenance_helpdesk_mgmt/readme/USAGE.md new file mode 100644 index 000000000..3a5ff3310 --- /dev/null +++ b/maintenance_helpdesk_mgmt/readme/USAGE.md @@ -0,0 +1,13 @@ +From Maintenance Requests +1. Navigate to **Maintenance > Maintenance Requests** +2. Open an existing maintenance request or create a new one +3. In the maintenance request form, you'll find a tab for **Helpdesk Tickets** +4. Use this tab to link one or more helpdesk tickets to the maintenance request +5. Select existing tickets or create new ones directly from this interface + +From Helpdesk Tickets +1. Navigate to **Helpdesk > Tickets** +2. Open a helpdesk ticket +3. If the ticket is linked to maintenance requests, you'll see a **Maintenance** smart button in the top-right area +4. Click the smart button to view all linked maintenance requests +5. The button shows the count of associated maintenance requests diff --git a/maintenance_helpdesk_mgmt/static/description/icon.png b/maintenance_helpdesk_mgmt/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/maintenance_helpdesk_mgmt/static/description/icon.png differ diff --git a/maintenance_helpdesk_mgmt/static/description/index.html b/maintenance_helpdesk_mgmt/static/description/index.html new file mode 100644 index 000000000..037f11c6d --- /dev/null +++ b/maintenance_helpdesk_mgmt/static/description/index.html @@ -0,0 +1,456 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Maintenance Request Helpdesk Ticket

+ +

Beta License: AGPL-3 OCA/maintenance Translate me on Weblate Try me on Runboat

+

This module allows to link maintenance requests with helpdesk tickets.

+

Table of contents

+ +
+

Usage

+

From Maintenance Requests

+
    +
  1. Navigate to Maintenance > Maintenance Requests
  2. +
  3. Open an existing maintenance request or create a new one
  4. +
  5. In the maintenance request form, you’ll find a tab for Helpdesk +Tickets
  6. +
  7. Use this tab to link one or more helpdesk tickets to the maintenance +request
  8. +
  9. Select existing tickets or create new ones directly from this +interface
  10. +
+

From Helpdesk Tickets

+
    +
  1. Navigate to Helpdesk > Tickets
  2. +
  3. Open a helpdesk ticket
  4. +
  5. If the ticket is linked to maintenance requests, you’ll see a +Maintenance smart button in the top-right area
  6. +
  7. Click the smart button to view all linked maintenance requests
  8. +
  9. The button shows the count of associated maintenance requests
  10. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa
      +
    • Christian Ramos
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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/maintenance project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/maintenance_helpdesk_mgmt/tests/__init__.py b/maintenance_helpdesk_mgmt/tests/__init__.py new file mode 100644 index 000000000..f870e6b4b --- /dev/null +++ b/maintenance_helpdesk_mgmt/tests/__init__.py @@ -0,0 +1 @@ +from . import test_maintenance_helpdesk_mgmt diff --git a/maintenance_helpdesk_mgmt/tests/test_maintenance_helpdesk_mgmt.py b/maintenance_helpdesk_mgmt/tests/test_maintenance_helpdesk_mgmt.py new file mode 100644 index 000000000..299a1c8c1 --- /dev/null +++ b/maintenance_helpdesk_mgmt/tests/test_maintenance_helpdesk_mgmt.py @@ -0,0 +1,55 @@ +# Copyright 2026 Tecnativa - Christian Ramos +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestMaintenanceHelpdeskMgmt(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.equipment = cls.env["maintenance.equipment"].create( + {"name": "Test Equipment"} + ) + cls.request = cls.env["maintenance.request"].create( + {"name": "Test Request", "equipment_id": cls.equipment.id} + ) + cls.ticket = cls.env["helpdesk.ticket"].create( + {"name": "Test Ticket", "description": "Test description"} + ) + + def test_compute_count_zero(self): + self.assertEqual(self.request.helpdesk_ticket_count, 0) + self.assertEqual(self.ticket.maintenance_request_count, 0) + + def test_link_request_and_ticket(self): + self.request.helpdesk_ticket_ids = [(4, self.ticket.id)] + self.assertEqual(self.request.helpdesk_ticket_count, 1) + self.assertEqual(self.ticket.maintenance_request_count, 1) + + def test_action_view_helpdesk_tickets_single(self): + self.request.helpdesk_ticket_ids = [(4, self.ticket.id)] + action = self.request.action_view_helpdesk_tickets() + self.assertEqual(action["res_id"], self.ticket.id) + self.assertEqual(action["views"], [(False, "form")]) + + def test_action_view_helpdesk_tickets_multi(self): + ticket_2 = self.env["helpdesk.ticket"].create( + {"name": "Test Ticket 2", "description": "Test description 2"} + ) + self.request.helpdesk_ticket_ids = [(4, self.ticket.id), (4, ticket_2.id)] + action = self.request.action_view_helpdesk_tickets() + self.assertIn(self.ticket.id, action["domain"][0][2]) + self.assertIn(ticket_2.id, action["domain"][0][2]) + + def test_action_view_maintenance_request_single(self): + self.ticket.maintenance_request_ids = [(4, self.request.id)] + action = self.ticket.action_view_maintenance_request() + self.assertEqual(action["res_id"], self.request.id) + self.assertEqual(action["views"], [(False, "form")]) + + def test_action_view_maintenance_request_multi(self): + request_2 = self.env["maintenance.request"].create({"name": "Test Request 2"}) + self.ticket.maintenance_request_ids = [(4, self.request.id), (4, request_2.id)] + action = self.ticket.action_view_maintenance_request() + self.assertIn(self.request.id, action["domain"][0][2]) + self.assertIn(request_2.id, action["domain"][0][2]) diff --git a/maintenance_helpdesk_mgmt/views/helpdesk_ticket_views.xml b/maintenance_helpdesk_mgmt/views/helpdesk_ticket_views.xml new file mode 100644 index 000000000..9fd4814e7 --- /dev/null +++ b/maintenance_helpdesk_mgmt/views/helpdesk_ticket_views.xml @@ -0,0 +1,70 @@ + + + + helpdesk.ticket.form.inherit + helpdesk.ticket + + +
+ + +
+
+
+ + + helpdesk.ticket.kanban + helpdesk.ticket + + + + + + + + + + + + + + + helpdesk.ticket.view.search + helpdesk.ticket + + + + + + + + + +
diff --git a/maintenance_helpdesk_mgmt/views/maintenance_request.xml b/maintenance_helpdesk_mgmt/views/maintenance_request.xml new file mode 100644 index 000000000..34ab61368 --- /dev/null +++ b/maintenance_helpdesk_mgmt/views/maintenance_request.xml @@ -0,0 +1,55 @@ + + + + maintenance.request.form + maintenance.request + + + + + + + + + + + + equipment.request.kanban + maintenance.request + + + + + + + + + + equipment.request.search + maintenance.request + + + + + + + + +