diff --git a/document_page_helpdesk_mgmt/README.rst b/document_page_helpdesk_mgmt/README.rst new file mode 100644 index 00000000000..a492e63a70f --- /dev/null +++ b/document_page_helpdesk_mgmt/README.rst @@ -0,0 +1,92 @@ +====================== +Document Page Helpdesk +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7719f9960f272becd8947205cf740d773e4a6a5599e3f2014dfd945f87227896 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fknowledge-lightgray.png?logo=github + :target: https://github.com/OCA/knowledge/tree/18.0/document_page_helpdesk_mgmt + :alt: OCA/knowledge +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/knowledge-18-0/knowledge-18-0-document_page_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/knowledge&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows linking document pages to helpdesk tickets. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- Go to a helpdesk ticket and click on "Wiki Pages" to see linked + documents or to create new ones. + +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 +------- + +* Escodoo + +Contributors +------------ + +- ``Escodoo ``\ \_: + + - Cristiano Mafra Junior cristiano.mafra@escodoo.com.br + +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. + +.. |maintainer-CristianoMafraJunior| image:: https://github.com/CristianoMafraJunior.png?size=40px + :target: https://github.com/CristianoMafraJunior + :alt: CristianoMafraJunior + +Current `maintainer `__: + +|maintainer-CristianoMafraJunior| + +This module is part of the `OCA/knowledge `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/document_page_helpdesk_mgmt/__init__.py b/document_page_helpdesk_mgmt/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/document_page_helpdesk_mgmt/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/document_page_helpdesk_mgmt/__manifest__.py b/document_page_helpdesk_mgmt/__manifest__.py new file mode 100644 index 00000000000..b0a1c7bdce9 --- /dev/null +++ b/document_page_helpdesk_mgmt/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2026 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Document Page Helpdesk", + "summary": "This module links document pages to helpdesk tickets", + "version": "18.0.1.0.0", + "category": "Helpdesk", + "author": "Escodoo, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/knowledge", + "license": "AGPL-3", + "depends": ["helpdesk_mgmt", "document_page"], + "maintainers": ["CristianoMafraJunior"], + "data": ["views/document_page_views.xml", "views/helpdesk_ticket_views.xml"], + "installable": True, +} diff --git a/document_page_helpdesk_mgmt/models/__init__.py b/document_page_helpdesk_mgmt/models/__init__.py new file mode 100644 index 00000000000..e64dc95bc4e --- /dev/null +++ b/document_page_helpdesk_mgmt/models/__init__.py @@ -0,0 +1,2 @@ +from . import document_page +from . import helpdesk_ticket diff --git a/document_page_helpdesk_mgmt/models/document_page.py b/document_page_helpdesk_mgmt/models/document_page.py new file mode 100644 index 00000000000..e5970fa90db --- /dev/null +++ b/document_page_helpdesk_mgmt/models/document_page.py @@ -0,0 +1,16 @@ +# Copyright 2026 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class DocumentPage(models.Model): + _inherit = "document.page" + + helpdesk_ticket_ids = fields.Many2many( + string="Helpdesk Tickets", + comodel_name="helpdesk.ticket", + relation="document_page_helpdesk_ticket_rel", + column1="document_page_id", + column2="helpdesk_ticket_id", + ) diff --git a/document_page_helpdesk_mgmt/models/helpdesk_ticket.py b/document_page_helpdesk_mgmt/models/helpdesk_ticket.py new file mode 100644 index 00000000000..2af886c059c --- /dev/null +++ b/document_page_helpdesk_mgmt/models/helpdesk_ticket.py @@ -0,0 +1,21 @@ +# Copyright 2026 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HelpdeskTicket(models.Model): + _inherit = "helpdesk.ticket" + + document_page_ids = fields.Many2many( + string="Wiki", + comodel_name="document.page", + relation="document_page_helpdesk_ticket_rel", + column1="helpdesk_ticket_id", + column2="document_page_id", + ) + document_page_count = fields.Integer(compute="_compute_document_page_count") + + def _compute_document_page_count(self): + for rec in self: + rec.document_page_count = len(rec.document_page_ids) diff --git a/document_page_helpdesk_mgmt/pyproject.toml b/document_page_helpdesk_mgmt/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/document_page_helpdesk_mgmt/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/document_page_helpdesk_mgmt/readme/CONTRIBUTORS.md b/document_page_helpdesk_mgmt/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..418948a9f56 --- /dev/null +++ b/document_page_helpdesk_mgmt/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +* `Escodoo `_: + + * Cristiano Mafra Junior diff --git a/document_page_helpdesk_mgmt/readme/DESCRIPTION.md b/document_page_helpdesk_mgmt/readme/DESCRIPTION.md new file mode 100644 index 00000000000..702beec5076 --- /dev/null +++ b/document_page_helpdesk_mgmt/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows linking document pages to helpdesk tickets. diff --git a/document_page_helpdesk_mgmt/readme/USAGE.md b/document_page_helpdesk_mgmt/readme/USAGE.md new file mode 100644 index 00000000000..83fb9af83e9 --- /dev/null +++ b/document_page_helpdesk_mgmt/readme/USAGE.md @@ -0,0 +1,2 @@ +- Go to a helpdesk ticket and click on "Wiki Pages" to see linked documents + or to create new ones. diff --git a/document_page_helpdesk_mgmt/static/description/icon.png b/document_page_helpdesk_mgmt/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/document_page_helpdesk_mgmt/static/description/icon.png differ diff --git a/document_page_helpdesk_mgmt/static/description/index.html b/document_page_helpdesk_mgmt/static/description/index.html new file mode 100644 index 00000000000..4ca3fd52c7b --- /dev/null +++ b/document_page_helpdesk_mgmt/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +Document Page Helpdesk + + + +
+

Document Page Helpdesk

+ + +

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

+

This module allows linking document pages to helpdesk tickets.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to a helpdesk ticket and click on “Wiki Pages” to see linked +documents or to create new ones.
  • +
+
+
+

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

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

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.

+

Current maintainer:

+

CristianoMafraJunior

+

This module is part of the OCA/knowledge project on GitHub.

+

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

+
+
+
+ + diff --git a/document_page_helpdesk_mgmt/tests/__init__.py b/document_page_helpdesk_mgmt/tests/__init__.py new file mode 100644 index 00000000000..5b420011e02 --- /dev/null +++ b/document_page_helpdesk_mgmt/tests/__init__.py @@ -0,0 +1 @@ +from . import test_helpdesk_ticket diff --git a/document_page_helpdesk_mgmt/tests/test_helpdesk_ticket.py b/document_page_helpdesk_mgmt/tests/test_helpdesk_ticket.py new file mode 100644 index 00000000000..119f40c6c63 --- /dev/null +++ b/document_page_helpdesk_mgmt/tests/test_helpdesk_ticket.py @@ -0,0 +1,43 @@ +# Copyright 2026 - TODAY, Cristiano Mafra Junior +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import common + + +class TestHelpdeskTicket(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.Page = cls.env["document.page"] + cls.Ticket = cls.env["helpdesk.ticket"] + cls.Team = cls.env["helpdesk.ticket.team"] + cls.default_page = cls.Page.create({"name": "My page"}) + cls.default_team = cls.Team.create({"name": "Team A"}) + + def test_page_count(self): + ticket = self.Ticket.create( + { + "name": "Ticket A", + "description": "Ticket description", + "team_id": self.default_team.id, + } + ) + + self.assertEqual( + ticket.document_page_count, 0, "Initial page count should be zero" + ) + + self.default_page.helpdesk_ticket_ids = [(4, ticket.id)] + ticket._compute_document_page_count() + + self.assertEqual( + ticket.document_page_count, + 1, + "After attaching ticket to document the page count should be one", + ) + self.assertIn( + self.default_page, + ticket.document_page_ids, + "The page should be in the list of document pages for ticket", + ) diff --git a/document_page_helpdesk_mgmt/views/document_page_views.xml b/document_page_helpdesk_mgmt/views/document_page_views.xml new file mode 100644 index 00000000000..f5a4c96bc99 --- /dev/null +++ b/document_page_helpdesk_mgmt/views/document_page_views.xml @@ -0,0 +1,36 @@ + + + + document.page.form - document_page_helpdesk_mgmt + document.page + + + + + + + + + Helpdesk Wiki + document.page + [('type','=','content'), ('helpdesk_ticket_ids', 'in', active_id)] + { + 'default_type': 'content', + 'default_helpdesk_ticket_ids': [active_id]} + list,form + + + +

+ Click to create a new web page. +

+
+
+
diff --git a/document_page_helpdesk_mgmt/views/helpdesk_ticket_views.xml b/document_page_helpdesk_mgmt/views/helpdesk_ticket_views.xml new file mode 100644 index 00000000000..abc582e4437 --- /dev/null +++ b/document_page_helpdesk_mgmt/views/helpdesk_ticket_views.xml @@ -0,0 +1,49 @@ + + + + helpdesk.ticket kanban + helpdesk.ticket + + + + +
+ + + + Wiki Pages +
+
+
+
+
+ + helpdesk.ticket.form - document_page_helpdesk_mgmt + helpdesk.ticket + + +
+ +
+
+
+