diff --git a/agreement_helpdesk_mgmt/README.rst b/agreement_helpdesk_mgmt/README.rst new file mode 100644 index 000000000..c4e5327d5 --- /dev/null +++ b/agreement_helpdesk_mgmt/README.rst @@ -0,0 +1,99 @@ +======================= +Agreement Helpdesk Mgmt +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/12.0/agreement_helpdesk_mgmt + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_helpdesk_mgmt + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Odoo Agreement App does not provide an easy way to access helpdesk tickets +related to an agreement. Some organizations need to have a quick access to +helpdesk tickets to track the performance of an agreement. + +This module allows you to link a helpdesk ticket to an agreement and adds a +smart button on the agreement to look at the list of related helpdesk tickets. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Helpdesk > Tickets +* Select or create a helpdesk ticket and set the agreement +* Go to Agreement > Agreements +* Open the previous agreement +* Click on the smart button "Tickets" to see the list of related helpdesk tickets + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* Bhavesh Odedra +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Marcel Savegnago - Escodoo + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators +* `Escodoo `_ + +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/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_helpdesk_mgmt/__init__.py b/agreement_helpdesk_mgmt/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/agreement_helpdesk_mgmt/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement_helpdesk_mgmt/__manifest__.py b/agreement_helpdesk_mgmt/__manifest__.py new file mode 100644 index 000000000..cc851988f --- /dev/null +++ b/agreement_helpdesk_mgmt/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2020 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Agreement Helpdesk Mgmt', + 'summary': """ + Link a helpdesk ticket to an agreement""", + 'version': '12.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Open Source Integrators,Escodoo,Odoo Community Association (OCA)', + 'website': 'https://github.com/oca/contract', + 'images': ['static/description/banner.png'], + 'depends': [ + "helpdesk_mgmt", + "agreement_serviceprofile", + ], + 'data': [ + 'views/helpdesk_ticket.xml', + 'views/agreement.xml', + ], + 'maintainers': [ + 'bodedra' + ], +} diff --git a/agreement_helpdesk_mgmt/models/__init__.py b/agreement_helpdesk_mgmt/models/__init__.py new file mode 100644 index 000000000..d94ee910f --- /dev/null +++ b/agreement_helpdesk_mgmt/models/__init__.py @@ -0,0 +1,2 @@ +from . import agreement +from . import helpdesk_ticket diff --git a/agreement_helpdesk_mgmt/models/agreement.py b/agreement_helpdesk_mgmt/models/agreement.py new file mode 100644 index 000000000..cbceb461e --- /dev/null +++ b/agreement_helpdesk_mgmt/models/agreement.py @@ -0,0 +1,41 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class Agreement(models.Model): + _inherit = 'agreement' + + ticket_ids = fields.One2many( + 'helpdesk.ticket', + 'agreement_id', + string="Tickets" + ) + + ticket_count = fields.Integer( + compute='_compute_ticket_count', + string='# Tickets' + ) + + @api.depends('ticket_ids') + def _compute_ticket_count(self): + for rec in self: + rec.ticket_count = len( + rec.ticket_ids) + + @api.multi + def action_view_ticket(self): + for agreement in self: + action = self.env.ref( + 'helpdesk_mgmt.helpdesk_ticket_action').read()[0] + action['context'] = {} + if len(self.ticket_ids) == 1: + action['views'] = [( + self.env.ref('helpdesk_mgmt.ticket_view_form').id, + 'form')] + action['res_id'] = self.ticket_ids.ids[0] + else: + action['domain'] = [('id', 'in', self.ticket_ids.ids)] + return action diff --git a/agreement_helpdesk_mgmt/models/helpdesk_ticket.py b/agreement_helpdesk_mgmt/models/helpdesk_ticket.py new file mode 100644 index 000000000..a6c1635ba --- /dev/null +++ b/agreement_helpdesk_mgmt/models/helpdesk_ticket.py @@ -0,0 +1,15 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HelpdeskTicket(models.Model): + _inherit = 'helpdesk.ticket' + + agreement_id = fields.Many2one( + 'agreement', + string='Agreement', + ) + serviceprofile_id = fields.Many2one('agreement.serviceprofile', + 'Service Profile') diff --git a/agreement_helpdesk_mgmt/readme/CONTRIBUTORS.rst b/agreement_helpdesk_mgmt/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..51dc69258 --- /dev/null +++ b/agreement_helpdesk_mgmt/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Bhavesh Odedra +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Marcel Savegnago - Escodoo diff --git a/agreement_helpdesk_mgmt/readme/CREDITS.rst b/agreement_helpdesk_mgmt/readme/CREDITS.rst new file mode 100644 index 000000000..8209266d9 --- /dev/null +++ b/agreement_helpdesk_mgmt/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Open Source Integrators diff --git a/agreement_helpdesk_mgmt/readme/DESCRIPTION.rst b/agreement_helpdesk_mgmt/readme/DESCRIPTION.rst new file mode 100644 index 000000000..0b55ceae1 --- /dev/null +++ b/agreement_helpdesk_mgmt/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +Odoo Agreement App does not provide an easy way to access helpdesk tickets +related to an agreement. Some organizations need to have a quick access to +helpdesk tickets to track the performance of an agreement. + +This module allows you to link a helpdesk ticket to an agreement and adds a +smart button on the agreement to look at the list of related helpdesk tickets. diff --git a/agreement_helpdesk_mgmt/readme/USAGE.rst b/agreement_helpdesk_mgmt/readme/USAGE.rst new file mode 100644 index 000000000..ea8595080 --- /dev/null +++ b/agreement_helpdesk_mgmt/readme/USAGE.rst @@ -0,0 +1,5 @@ +* Go to Helpdesk > Tickets +* Select or create a helpdesk ticket and set the agreement +* Go to Agreement > Agreements +* Open the previous agreement +* Click on the smart button "Tickets" to see the list of related helpdesk tickets diff --git a/agreement_helpdesk_mgmt/static/description/banner.png b/agreement_helpdesk_mgmt/static/description/banner.png new file mode 100644 index 000000000..da4f6de2a Binary files /dev/null and b/agreement_helpdesk_mgmt/static/description/banner.png differ diff --git a/agreement_helpdesk_mgmt/static/description/icon.png b/agreement_helpdesk_mgmt/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/agreement_helpdesk_mgmt/static/description/icon.png differ diff --git a/agreement_helpdesk_mgmt/static/description/index.html b/agreement_helpdesk_mgmt/static/description/index.html new file mode 100644 index 000000000..55320993d --- /dev/null +++ b/agreement_helpdesk_mgmt/static/description/index.html @@ -0,0 +1,447 @@ + + + + + + +Agreement Helpdesk Mgmt + + + +
+

Agreement Helpdesk Mgmt

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

Odoo Agreement App does not provide an easy way to access helpdesk tickets +related to an agreement. Some organizations need to have a quick access to +helpdesk tickets to track the performance of an agreement.

+

This module allows you to link a helpdesk ticket to an agreement and adds a +smart button on the agreement to look at the list of related helpdesk tickets.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Helpdesk > Tickets
  • +
  • Select or create a helpdesk ticket and set the agreement
  • +
  • Go to Agreement > Agreements
  • +
  • Open the previous agreement
  • +
  • Click on the smart button “Tickets” to see the list of related helpdesk tickets
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Open Source Integrators
  • +
  • Escodoo
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/agreement_helpdesk_mgmt/tests/__init__.py b/agreement_helpdesk_mgmt/tests/__init__.py new file mode 100644 index 000000000..2b14b52a6 --- /dev/null +++ b/agreement_helpdesk_mgmt/tests/__init__.py @@ -0,0 +1 @@ +from . import test_agreement_helpdesk_mgmt diff --git a/agreement_helpdesk_mgmt/tests/test_agreement_helpdesk_mgmt.py b/agreement_helpdesk_mgmt/tests/test_agreement_helpdesk_mgmt.py new file mode 100644 index 000000000..5e85d17c8 --- /dev/null +++ b/agreement_helpdesk_mgmt/tests/test_agreement_helpdesk_mgmt.py @@ -0,0 +1,34 @@ +# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import odoo.tests.common as common + + +class TestAgreementHelpdeskMgmt(common.SavepointCase): + + @classmethod + def setUpClass(cls): + super(TestAgreementHelpdeskMgmt, cls).setUpClass() + cls.partner = cls.env['res.partner'].create({ + 'name': 'Test Partner', + 'email': 'test@test.com', + }) + cls.agreement = cls.env['agreement'].create({ + 'name': 'Test Agreement', + 'partner_id': cls.partner.id, + }) + cls.ticket = cls.env['helpdesk.ticket'].create({ + 'name': 'Test Helpdesk Ticket', + 'description': 'Test Helpdesk Ticket', + 'partner_id': cls.partner.id, + 'agreement_id': cls.agreement.id, + }) + + def test_compute_ticket_count(self): + self.agreement._compute_ticket_count() + self.assertEqual( + self.agreement.ticket_count, 1) + + def test_action_view_ticket(self): + result = self.agreement.action_view_ticket() + self.assertEqual(result['res_id'], self.ticket.id) diff --git a/agreement_helpdesk_mgmt/views/agreement.xml b/agreement_helpdesk_mgmt/views/agreement.xml new file mode 100644 index 000000000..b8f16292a --- /dev/null +++ b/agreement_helpdesk_mgmt/views/agreement.xml @@ -0,0 +1,25 @@ + + + + + + agreement.form (in agreement_helpdesk_mgmt) + agreement + + +
+ +
+
+
+ +
diff --git a/agreement_helpdesk_mgmt/views/helpdesk_ticket.xml b/agreement_helpdesk_mgmt/views/helpdesk_ticket.xml new file mode 100644 index 000000000..242fe4998 --- /dev/null +++ b/agreement_helpdesk_mgmt/views/helpdesk_ticket.xml @@ -0,0 +1,36 @@ + + + + + + helpdesk.ticket.form (in agreement_helpdesk_mgmt) + helpdesk.ticket + + + + + + + + + + + helpdesk.ticket.search (in agreement_helpdesk_mgmt) + helpdesk.ticket + + + + + + + + + diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 915dd1d8b..31f5c64a2 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -5,3 +5,4 @@ sale-reporting account-invoicing account-closing sale-workflow +helpdesk