diff --git a/helpdesk_mgmt_stock_grn/README.rst b/helpdesk_mgmt_stock_grn/README.rst new file mode 100644 index 0000000000..cbb0b226ba --- /dev/null +++ b/helpdesk_mgmt_stock_grn/README.rst @@ -0,0 +1,76 @@ +======================= +Helpdesk Mgmt Stock Grn +======================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:58173e15cb0efae574587ac4945c07166285acfe4ecd612f5be88ac188f40604 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fhelpdesk-lightgray.png?logo=github + :target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_mgmt_stock_grn + :alt: OCA/helpdesk +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_mgmt_stock_grn + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Enables to link a GRN to helpdesk ticket. + +**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 +------- + +* ACSONE SA/NV + +Contributors +------------ + +- Nicolas Delbovier nicolas.delbovier@acsone.eu (https://www.acsone.eu/) + +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/helpdesk `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/helpdesk_mgmt_stock_grn/__init__.py b/helpdesk_mgmt_stock_grn/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/helpdesk_mgmt_stock_grn/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/helpdesk_mgmt_stock_grn/__manifest__.py b/helpdesk_mgmt_stock_grn/__manifest__.py new file mode 100644 index 0000000000..76998c3e8a --- /dev/null +++ b/helpdesk_mgmt_stock_grn/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2026 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Helpdesk Mgmt Stock Grn", + "summary": """Enables to link a GRN to helpdesk ticket""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/helpdesk", + "depends": ["helpdesk_mgmt_stock", "stock_grn"], + "data": [ + "views/helpdesk_ticket.xml", + ], + "demo": [], +} diff --git a/helpdesk_mgmt_stock_grn/models/__init__.py b/helpdesk_mgmt_stock_grn/models/__init__.py new file mode 100644 index 0000000000..8e082e7c81 --- /dev/null +++ b/helpdesk_mgmt_stock_grn/models/__init__.py @@ -0,0 +1 @@ +from . import helpdesk_ticket diff --git a/helpdesk_mgmt_stock_grn/models/helpdesk_ticket.py b/helpdesk_mgmt_stock_grn/models/helpdesk_ticket.py new file mode 100644 index 0000000000..d8699f9a4c --- /dev/null +++ b/helpdesk_mgmt_stock_grn/models/helpdesk_ticket.py @@ -0,0 +1,21 @@ +# Copyright 2026 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HelpdeskTicket(models.Model): + _inherit = "helpdesk.ticket" + + grn_id = fields.Many2one( + related="stock_picking_id.grn_id", + string="Goods Received Note", + ) + grn_date = fields.Datetime( + related="grn_id.date", + string="GRN Date", + ) + delivery_note_supplier_number = fields.Char( + related="grn_id.delivery_note_supplier_number", + string="Supplier delivery note number", + ) diff --git a/helpdesk_mgmt_stock_grn/readme/CONTRIBUTORS.md b/helpdesk_mgmt_stock_grn/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..e0604c970f --- /dev/null +++ b/helpdesk_mgmt_stock_grn/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Nicolas Delbovier (https://www.acsone.eu/) \ No newline at end of file diff --git a/helpdesk_mgmt_stock_grn/readme/DESCRIPTION.md b/helpdesk_mgmt_stock_grn/readme/DESCRIPTION.md new file mode 100644 index 0000000000..da7ed898c3 --- /dev/null +++ b/helpdesk_mgmt_stock_grn/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Enables to link a GRN to helpdesk ticket. \ No newline at end of file diff --git a/helpdesk_mgmt_stock_grn/static/description/icon.png b/helpdesk_mgmt_stock_grn/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/helpdesk_mgmt_stock_grn/static/description/icon.png differ diff --git a/helpdesk_mgmt_stock_grn/static/description/index.html b/helpdesk_mgmt_stock_grn/static/description/index.html new file mode 100644 index 0000000000..8a055b23df --- /dev/null +++ b/helpdesk_mgmt_stock_grn/static/description/index.html @@ -0,0 +1,423 @@ + + + + + +Helpdesk Mgmt Stock Grn + + + +
+

Helpdesk Mgmt Stock Grn

+ + +

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

+

Enables to link a GRN to helpdesk ticket.

+

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

+
    +
  • ACSONE SA/NV
  • +
+
+ +
+

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

+

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

+
+
+
+ + diff --git a/helpdesk_mgmt_stock_grn/tests/__init__.py b/helpdesk_mgmt_stock_grn/tests/__init__.py new file mode 100644 index 0000000000..4b87c61db3 --- /dev/null +++ b/helpdesk_mgmt_stock_grn/tests/__init__.py @@ -0,0 +1 @@ +from . import test_helpdesk_mgmt_stock_grn diff --git a/helpdesk_mgmt_stock_grn/tests/test_helpdesk_mgmt_stock_grn.py b/helpdesk_mgmt_stock_grn/tests/test_helpdesk_mgmt_stock_grn.py new file mode 100644 index 0000000000..8a0356a491 --- /dev/null +++ b/helpdesk_mgmt_stock_grn/tests/test_helpdesk_mgmt_stock_grn.py @@ -0,0 +1,69 @@ +# Copyright 2026 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.fields import Datetime +from odoo.tests import common + + +class TestHelpdeskTicketGrn(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.carrier = cls.env["res.partner"].create( + { + "name": "Test Carrier", + } + ) + cls.grn = cls.env["stock.grn"].create( + { + "date": Datetime.now(), + "delivery_note_supplier_number": "SUPP-TEST", + "carrier_id": cls.carrier.id, + } + ) + cls.picking = cls.env["stock.picking"].create( + { + "picking_type_id": cls.env.ref("stock.picking_type_in").id, + "location_id": cls.env.ref("stock.stock_location_suppliers").id, + "location_dest_id": cls.env.ref("stock.stock_location_stock").id, + "grn_id": cls.grn.id, + } + ) + + def test_grn_related_fields(self): + """Test that helpdesk ticket correctly pulls data from GRN via Picking.""" + ticket = self.env["helpdesk.ticket"].create( + { + "name": "Test Ticket", + "stock_picking_id": self.picking.id, + "description": "Test description", + } + ) + + self.assertEqual(ticket.grn_id, self.grn, "GRN ID was not pulled correctly.") + self.assertEqual(ticket.grn_date, self.grn.date, "GRN Date does not match.") + self.assertEqual( + ticket.delivery_note_supplier_number, + self.grn.delivery_note_supplier_number, + "Supplier delivery note number does not match.", + ) + + def test_grn_change_propagation(self): + """Test that changing the GRN on the picking updates the ticket.""" + ticket = self.env["helpdesk.ticket"].create( + { + "name": "Update Ticket", + "stock_picking_id": self.picking.id, + "description": "Test description again", + } + ) + + new_grn = self.env["stock.grn"].create( + { + "delivery_note_supplier_number": "SUPP-TEST-2", + "carrier_id": self.carrier.id, + } + ) + self.picking.grn_id = new_grn + self.assertEqual(ticket.delivery_note_supplier_number, "SUPP-TEST-2") diff --git a/helpdesk_mgmt_stock_grn/views/helpdesk_ticket.xml b/helpdesk_mgmt_stock_grn/views/helpdesk_ticket.xml new file mode 100644 index 0000000000..4fa0910a83 --- /dev/null +++ b/helpdesk_mgmt_stock_grn/views/helpdesk_ticket.xml @@ -0,0 +1,18 @@ + + + + + + helpdesk.ticket + + + + + + + + + + + diff --git a/setup/helpdesk_mgmt_stock_grn/odoo/addons/helpdesk_mgmt_stock_grn b/setup/helpdesk_mgmt_stock_grn/odoo/addons/helpdesk_mgmt_stock_grn new file mode 120000 index 0000000000..896ab0a6b6 --- /dev/null +++ b/setup/helpdesk_mgmt_stock_grn/odoo/addons/helpdesk_mgmt_stock_grn @@ -0,0 +1 @@ +../../../../helpdesk_mgmt_stock_grn \ No newline at end of file diff --git a/setup/helpdesk_mgmt_stock_grn/setup.py b/setup/helpdesk_mgmt_stock_grn/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/helpdesk_mgmt_stock_grn/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..c21b33cba0 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-helpdesk-mgmt-stock @ git+https://github.com/OCA/helpdesk.git@refs/pull/875/head#subdirectory=setup/helpdesk_mgmt_stock