diff --git a/agreement_helpdesk_mgmt_fieldservice/README.rst b/agreement_helpdesk_mgmt_fieldservice/README.rst new file mode 100644 index 00000000..2745c012 --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/README.rst @@ -0,0 +1,76 @@ +==================================== +Agreement Helpdesk Mgmt Fieldservice +==================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b29ad1c0b0dc460419c299ce1d4bd62d7d4ab8cee4871900214de9d01d6e9cd1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fagreement-lightgray.png?logo=github + :target: https://github.com/OCA/agreement/tree/18.0/agreement_helpdesk_mgmt_fieldservice + :alt: OCA/agreement +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/agreement-18-0/agreement-18-0-agreement_helpdesk_mgmt_fieldservice + :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/agreement&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Propagates the helpdesk ticket's agreement when creating a FSM Order. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Camptocamp + +Contributors +------------ + +- Vincent Van Rossem + +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/agreement `_ 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_fieldservice/__init__.py b/agreement_helpdesk_mgmt_fieldservice/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement_helpdesk_mgmt_fieldservice/__manifest__.py b/agreement_helpdesk_mgmt_fieldservice/__manifest__.py new file mode 100644 index 00000000..6ebbe1e2 --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Agreement Helpdesk Mgmt Fieldservice", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/agreement", + "depends": [ + # oca/agreement + "agreement_helpdesk_mgmt", + # oca/helpdesk + "helpdesk_mgmt_fieldservice", + # oca/field-service + "fieldservice_agreement", + ], + "auto_install": True, +} diff --git a/agreement_helpdesk_mgmt_fieldservice/models/__init__.py b/agreement_helpdesk_mgmt_fieldservice/models/__init__.py new file mode 100644 index 00000000..8e082e7c --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/models/__init__.py @@ -0,0 +1 @@ +from . import helpdesk_ticket diff --git a/agreement_helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py b/agreement_helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py new file mode 100644 index 00000000..ec1d5b2a --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/models/helpdesk_ticket.py @@ -0,0 +1,14 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class HelpdeskTicket(models.Model): + _inherit = "helpdesk.ticket" + + def action_create_order(self): + action = super().action_create_order() + if agreement := self.agreement_id: + action["context"]["default_agreement_id"] = agreement.id + return action diff --git a/agreement_helpdesk_mgmt_fieldservice/pyproject.toml b/agreement_helpdesk_mgmt_fieldservice/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/agreement_helpdesk_mgmt_fieldservice/readme/CONTRIBUTORS.md b/agreement_helpdesk_mgmt_fieldservice/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..77f9a96d --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Vincent Van Rossem \<\> diff --git a/agreement_helpdesk_mgmt_fieldservice/readme/DESCRIPTION.md b/agreement_helpdesk_mgmt_fieldservice/readme/DESCRIPTION.md new file mode 100644 index 00000000..0505342a --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Propagates the helpdesk ticket's agreement when creating a FSM Order. diff --git a/agreement_helpdesk_mgmt_fieldservice/static/description/index.html b/agreement_helpdesk_mgmt_fieldservice/static/description/index.html new file mode 100644 index 00000000..3982d849 --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/static/description/index.html @@ -0,0 +1,423 @@ + + + + + +Agreement Helpdesk Mgmt Fieldservice + + + +
+

Agreement Helpdesk Mgmt Fieldservice

+ + +

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

+

Propagates the helpdesk ticket’s agreement when creating a FSM Order.

+

Table of contents

+ +
+

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

+
    +
  • Camptocamp
  • +
+
+
+

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.

+

This module is part of the OCA/agreement 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_fieldservice/tests/__init__.py b/agreement_helpdesk_mgmt_fieldservice/tests/__init__.py new file mode 100644 index 00000000..d485a109 --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/tests/__init__.py @@ -0,0 +1 @@ +from . import test_helpdesk_ticket_fsm_order_agreement diff --git a/agreement_helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order_agreement.py b/agreement_helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order_agreement.py new file mode 100644 index 00000000..e76e2da3 --- /dev/null +++ b/agreement_helpdesk_mgmt_fieldservice/tests/test_helpdesk_ticket_fsm_order_agreement.py @@ -0,0 +1,30 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.helpdesk_mgmt_fieldservice.tests.test_helpdesk_ticket_fsm_order import ( # noqa: E501 + TestHelpdeskTicketFSMOrder, +) + + +class TestHelpdeskTicketFSMOrderAgreement(TestHelpdeskTicketFSMOrder): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.agreement = cls.env["agreement"].create({"name": "Test Agreement"}) + cls.ticket_1.write( + { + "agreement_id": cls.agreement.id, + } + ) + + def test_helpdesk_ticket_fsm_order_propagation(self): + fsm_orders = self._create_ticket_fsm_orders(self.ticket_1, 5) + self.assertRecordValues( + fsm_orders, + [ + { + "agreement_id": self.agreement.id, + } + for _ in range(5) + ], + )