diff --git a/setup/shopfloor_reception_helpdesk/odoo/addons/shopfloor_reception_helpdesk b/setup/shopfloor_reception_helpdesk/odoo/addons/shopfloor_reception_helpdesk new file mode 120000 index 0000000000..85b13bc8c6 --- /dev/null +++ b/setup/shopfloor_reception_helpdesk/odoo/addons/shopfloor_reception_helpdesk @@ -0,0 +1 @@ +../../../../shopfloor_reception_helpdesk \ No newline at end of file diff --git a/setup/shopfloor_reception_helpdesk/setup.py b/setup/shopfloor_reception_helpdesk/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopfloor_reception_helpdesk/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/shopfloor_reception_helpdesk_mobile/odoo/addons/shopfloor_reception_helpdesk_mobile b/setup/shopfloor_reception_helpdesk_mobile/odoo/addons/shopfloor_reception_helpdesk_mobile new file mode 120000 index 0000000000..04c0d688e5 --- /dev/null +++ b/setup/shopfloor_reception_helpdesk_mobile/odoo/addons/shopfloor_reception_helpdesk_mobile @@ -0,0 +1 @@ +../../../../shopfloor_reception_helpdesk_mobile \ No newline at end of file diff --git a/setup/shopfloor_reception_helpdesk_mobile/setup.py b/setup/shopfloor_reception_helpdesk_mobile/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopfloor_reception_helpdesk_mobile/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopfloor_reception_helpdesk/README.rst b/shopfloor_reception_helpdesk/README.rst new file mode 100644 index 0000000000..c46aee26ca --- /dev/null +++ b/shopfloor_reception_helpdesk/README.rst @@ -0,0 +1,78 @@ +============================ +Shopfloor Reception Helpdesk +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:95ca35958dc1759c81813ab6346c438756ab14f791a1fcdc258df16ca85f4d30 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fwms-lightgray.png?logo=github + :target: https://github.com/OCA/wms/tree/16.0/shopfloor_reception_helpdesk + :alt: OCA/wms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-shopfloor_reception_helpdesk + :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/wms&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to present services for shopfloor reception helpdesk +tickets declarations. + +**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 +------------ + +- Denis Roussel denis.roussel@acsone.eu +- Nicolas Delbovier nicolas.delbovier@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/wms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/shopfloor_reception_helpdesk/__init__.py b/shopfloor_reception_helpdesk/__init__.py new file mode 100644 index 0000000000..45f829a2eb --- /dev/null +++ b/shopfloor_reception_helpdesk/__init__.py @@ -0,0 +1,3 @@ +from . import services +from . import actions +from . import wizards diff --git a/shopfloor_reception_helpdesk/__manifest__.py b/shopfloor_reception_helpdesk/__manifest__.py new file mode 100644 index 0000000000..1ec482b27d --- /dev/null +++ b/shopfloor_reception_helpdesk/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopfloor Reception Helpdesk", + "summary": """This module allows to create helpdesk tickets in reception scenarios""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/wms", + "depends": ["shopfloor_reception", "helpdesk_mgmt_stock", "helpdesk_motive"], +} diff --git a/shopfloor_reception_helpdesk/actions/__init__.py b/shopfloor_reception_helpdesk/actions/__init__.py new file mode 100644 index 0000000000..a075ec808a --- /dev/null +++ b/shopfloor_reception_helpdesk/actions/__init__.py @@ -0,0 +1,3 @@ +from . import messages +from . import data +from . import schema diff --git a/shopfloor_reception_helpdesk/actions/data.py b/shopfloor_reception_helpdesk/actions/data.py new file mode 100644 index 0000000000..551bb6cc2f --- /dev/null +++ b/shopfloor_reception_helpdesk/actions/data.py @@ -0,0 +1,33 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.addons.component.core import Component +from odoo.addons.shopfloor_base.utils import ensure_model + + +class DataAction(Component): + + _inherit = "shopfloor.data.action" + + def _get_picking_parser(self, record, **kw): + parser = super()._get_picking_parser(record, **kw) + if record.picking_type_id.allow_helpdesk_ticket: + parser.append("helpdesk_ticket_allowed") + return parser + + @ensure_model("stock.helpdesk.ticket.create") + def helpdesk_wizard(self, record, **kw): + parser = self._helpdesk_wizard_parser + data = self._jsonify(record, parser, **kw) + return data + + @property + def _helpdesk_wizard_parser(self): + return [ + "id", + "description", + ("motive_id:motive", self._helpdesk_motive_parser), + ] + + @property + def _helpdesk_motive_parser(self): + return ["id", "name"] diff --git a/shopfloor_reception_helpdesk/actions/messages.py b/shopfloor_reception_helpdesk/actions/messages.py new file mode 100644 index 0000000000..2caff38abf --- /dev/null +++ b/shopfloor_reception_helpdesk/actions/messages.py @@ -0,0 +1,18 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import _ + +from odoo.addons.component.core import Component + + +class MessageAction(Component): + _inherit = "shopfloor.message.action" + + def helpdesk_ticket_created(self, ticket): + return { + "message_type": "success", + "body": _( + "Helpdesk ticket (%(ticket_name)s) created!", + ticket_name=ticket.display_name, + ), + } diff --git a/shopfloor_reception_helpdesk/actions/schema.py b/shopfloor_reception_helpdesk/actions/schema.py new file mode 100644 index 0000000000..793d44b26b --- /dev/null +++ b/shopfloor_reception_helpdesk/actions/schema.py @@ -0,0 +1,30 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.addons.component.core import Component + + +class ShopfloorSchemaAction(Component): + _inherit = "shopfloor.schema.action" + + def picking(self): + schema = super().picking() + schema.update( + {"helpdesk_ticket_allowed": {"required": False, "type": "boolean"}} + ) + return schema + + def helpdesk_wizard(self): + return { + "id": {"required": True, "type": "integer"}, + "description": { + "type": "string", + "nullable": True, + }, + "motive": self._schema_dict_of(self.helpdesk_motive(), required=False), + } + + def helpdesk_motive(self): + return { + "id": {"required": True, "type": "integer"}, + "name": {"type": "string", "nullable": False, "required": True}, + } diff --git a/shopfloor_reception_helpdesk/readme/CONTRIBUTORS.md b/shopfloor_reception_helpdesk/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..83ad92aa32 --- /dev/null +++ b/shopfloor_reception_helpdesk/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Denis Roussel +- Nicolas Delbovier diff --git a/shopfloor_reception_helpdesk/readme/DESCRIPTION.md b/shopfloor_reception_helpdesk/readme/DESCRIPTION.md new file mode 100644 index 0000000000..55a2bb3491 --- /dev/null +++ b/shopfloor_reception_helpdesk/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to present services for shopfloor reception helpdesk +tickets declarations. diff --git a/shopfloor_reception_helpdesk/services/__init__.py b/shopfloor_reception_helpdesk/services/__init__.py new file mode 100644 index 0000000000..aa19bba8ce --- /dev/null +++ b/shopfloor_reception_helpdesk/services/__init__.py @@ -0,0 +1 @@ +from . import reception diff --git a/shopfloor_reception_helpdesk/services/reception.py b/shopfloor_reception_helpdesk/services/reception.py new file mode 100644 index 0000000000..9edbb86edd --- /dev/null +++ b/shopfloor_reception_helpdesk/services/reception.py @@ -0,0 +1,182 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.addons.base_rest.components.service import to_int +from odoo.addons.component.core import Component +from odoo.addons.helpdesk_mgmt_stock.wizards.stock_helpdesk_ticket_create import ( + StockHelpdeskTicketCreate, +) +from odoo.addons.stock.models.stock_move_line import StockMoveLine +from odoo.addons.stock.models.stock_picking import Picking + + +class Reception(Component): + _inherit = "shopfloor.reception" + + def start_helpdesk(self, picking_id: int, selected_line_id: int): + """ + Endpoint to start to fill in Helpdesk details + """ + picking = self.env["stock.picking"].browse(picking_id).exists() + line = self.env["stock.move.line"].browse(selected_line_id).exists() + # Create wizard in order to keep information through screens + wizard = self._create_helpdesk_wizard(picking, line) + return self._response( + next_state="start_helpdesk", + data={ + "selected_move_line": self._data_for_move_lines(line), + "picking": self.data.picking(picking), + "helpdesk_wizard": self.data.helpdesk_wizard(wizard), + "available_motives": self._get_available_motives(picking), + }, + ) + + def create_helpdesk( + self, + picking_id: int, + selected_line_id: int, + helpdesk_wizard_id: int, + description: str, + motive_id: int, + ): + """ + Endpoint to create the helpdesk ticket + """ + picking = self.env["stock.picking"].browse(picking_id).exists() + line = self.env["stock.move.line"].browse(selected_line_id).exists() + + wizard = ( + self.env["stock.helpdesk.ticket.create"].browse(helpdesk_wizard_id).exists() + ) + wizard.write( + { + "description": description, + "motive_id": motive_id, + } + ) + + ticket = self._create_helpdesk(picking, line, wizard) + message = {} + if ticket: + message = self.msg_store.helpdesk_ticket_created(ticket) + return self._response( + next_state="set_destination", + data={ + "selected_move_line": self._data_for_move_lines(line), + "picking": self.data.picking(picking), + }, + message=message, + ) + + def _prepare_ticket_wizard_values(self, picking: Picking, line: StockMoveLine): + return {} + + def _create_helpdesk_wizard(self, picking: Picking, line: StockMoveLine): + wizard = ( + self.env["stock.helpdesk.ticket.create"] + .with_context(active_model="stock.move", active_id=line.move_id.id) + .create(self._prepare_ticket_wizard_values(picking, line)) + ) + return wizard + + def _create_helpdesk( + self, + picking: Picking, + line: StockMoveLine, + wizard: StockHelpdeskTicketCreate, + **kwargs, + ): + tickets_before = line.move_id.helpdesk_ticket_ids + wizard.action_create_helpdesk_ticket() + ticket = line.move_id.helpdesk_ticket_ids - tickets_before + return ticket + + def _get_available_motives(self, picking: Picking) -> list[dict]: + default_helpdesk_team = picking.picking_type_id.default_helpdesk_team_id + return self.env["helpdesk.ticket.motive"].search_read( + [("team_id", "in", default_helpdesk_team.ids + [False])], ["id", "name"] + ) + + +class ShopfloorReceptionValidator(Component): + _inherit = "shopfloor.reception.validator" + + def start_helpdesk(self): + return { + "picking_id": {"coerce": to_int, "required": True, "type": "integer"}, + "selected_line_id": { + "coerce": to_int, + "type": "integer", + "required": True, + }, + } + + def create_helpdesk(self): + return { + "picking_id": {"coerce": to_int, "required": True, "type": "integer"}, + "selected_line_id": { + "coerce": to_int, + "type": "integer", + "required": True, + }, + "helpdesk_wizard_id": { + "coerce": to_int, + "type": "integer", + "required": True, + }, + "description": {"type": "string", "required": True}, + "motive_id": {"coerce": to_int, "type": "integer", "required": False}, + } + + +class ShopfloorReceptionValidatorResponse(Component): + _inherit = "shopfloor.reception.validator.response" + + def _states(self): + states = super()._states() + states.update( + { + "start_helpdesk": self._schema_start_helpdesk, + "create_helpdesk": self._schema_create_helpdesk, + } + ) + return states + + @property + def _schema_start_helpdesk(self): + return { + "selected_move_line": { + "type": "list", + "schema": {"type": "dict", "schema": self.schemas.move_line()}, + }, + "picking": {"type": "dict", "schema": self.schemas.picking()}, + "helpdesk_wizard": { + "type": "dict", + "schema": self.schemas.helpdesk_wizard(), + }, + "available_motives": { + "type": "list", + "schema": {"type": "dict", "schema": self.schemas.helpdesk_motive()}, + }, + } + + @property + def _schema_create_helpdesk(self): + return { + "selected_move_line": { + "type": "list", + "schema": {"type": "dict", "schema": self.schemas.move_line()}, + }, + "picking": {"type": "dict", "schema": self.schemas.picking()}, + } + + def _create_helpdesk_next_states(self): + return {"set_destination", "select_move"} + + def _start_helpdesk_next_states(self): + return {"start_helpdesk"} + + def start_helpdesk(self): + return self._response_schema(next_states=self._start_helpdesk_next_states()) + + def create_helpdesk(self): + return self._response_schema(next_states=self._create_helpdesk_next_states()) diff --git a/shopfloor_reception_helpdesk/static/description/icon.png b/shopfloor_reception_helpdesk/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/shopfloor_reception_helpdesk/static/description/icon.png differ diff --git a/shopfloor_reception_helpdesk/static/description/index.html b/shopfloor_reception_helpdesk/static/description/index.html new file mode 100644 index 0000000000..33c56f7222 --- /dev/null +++ b/shopfloor_reception_helpdesk/static/description/index.html @@ -0,0 +1,425 @@ + + + + + +Shopfloor Reception Helpdesk + + + +
+

Shopfloor Reception Helpdesk

+ + +

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

+

This module allows to present services for shopfloor reception helpdesk +tickets declarations.

+

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
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/shopfloor_reception_helpdesk/tests/test_reception_helpdesk.py b/shopfloor_reception_helpdesk/tests/test_reception_helpdesk.py new file mode 100644 index 0000000000..ed4ca525a3 --- /dev/null +++ b/shopfloor_reception_helpdesk/tests/test_reception_helpdesk.py @@ -0,0 +1,91 @@ +# Copyright 2025 ACSONE SA/NV (https://acsone.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.addons.shopfloor_reception.tests.common import CommonCase + + +class TestReceptionHelpdesk(CommonCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.PickingType = cls.env["stock.picking.type"].sudo() + cls.suppliers = cls.env.ref("stock.stock_location_suppliers") + cls.warehouse = cls.env.ref("stock.warehouse0") + cls.Product = cls.env["product.product"].sudo() + cls.purchase_team = ( + cls.env["helpdesk.ticket.team"].sudo().create({"name": "Purchase Helpdesk"}) + ) + + cls.type_rec = cls.PickingType.create( + { + "name": "Reception Test", + "sequence_code": "REC-TEST", + "allow_helpdesk_ticket": True, + "default_helpdesk_team_id": cls.purchase_team.id, + } + ) + cls.env.user.groups_id |= cls.env.ref("helpdesk_mgmt.group_helpdesk_user") + cls.motive = ( + cls.env["helpdesk.ticket.motive"] + .sudo() + .create({"name": "Test Motive", "team_id": cls.purchase_team.id}) + ) + cls.motive_no_team = ( + cls.env["helpdesk.ticket.motive"] + .sudo() + .create({"name": "Test Motive", "team_id": False}) + ) + + def test_set_done_backorder_urgent(self): + self.menu.sudo().picking_type_ids = self.type_rec + picking = self._create_picking(picking_type=self.type_rec) + line = picking.move_line_ids.filtered( + lambda line: line.product_id == self.product_a + ) + self.assertFalse(line.move_id.helpdesk_ticket_ids) + response = self.service.dispatch( + "start_helpdesk", + params={"picking_id": picking.id, "selected_line_id": line.id}, + ) + start_helpdesk_data = response["data"]["start_helpdesk"] + + self.assertEqual( + start_helpdesk_data["selected_move_line"], + self.data.move_lines(line), + ) + self.assertEqual(start_helpdesk_data["picking"], self.data.picking(picking)) + self.assertIn( + self.motive_no_team.id, + [m["id"] for m in start_helpdesk_data["available_motives"]], + ) + self.assertIn( + self.motive.id, [m["id"] for m in start_helpdesk_data["available_motives"]] + ) + + response = self.service.dispatch( + "create_helpdesk", + params={ + "picking_id": picking.id, + "selected_line_id": line.id, + "helpdesk_wizard_id": start_helpdesk_data["helpdesk_wizard"]["id"], + "description": "Test Helpdesk", + "motive_id": self.motive.id, + }, + ) + + helpdesk_ticket = line.move_id.helpdesk_ticket_ids + self.assertTrue(helpdesk_ticket) + self.assertEqual(helpdesk_ticket.motive_id, self.motive) + + message = f"Helpdesk ticket ({line.move_id.helpdesk_ticket_ids.display_name}) created!" + self.assert_response( + response, + next_state="set_destination", + data={ + "picking": self._data_for_picking(picking, with_progress=False), + "selected_move_line": self.data.move_lines(line), + }, + message={ + "body": message, + "message_type": "success", + }, + ) diff --git a/shopfloor_reception_helpdesk/wizards/__init__.py b/shopfloor_reception_helpdesk/wizards/__init__.py new file mode 100644 index 0000000000..6d53cbe1e0 --- /dev/null +++ b/shopfloor_reception_helpdesk/wizards/__init__.py @@ -0,0 +1 @@ +from . import stock_helpdesk_ticket_create diff --git a/shopfloor_reception_helpdesk/wizards/stock_helpdesk_ticket_create.py b/shopfloor_reception_helpdesk/wizards/stock_helpdesk_ticket_create.py new file mode 100644 index 0000000000..6f20e52645 --- /dev/null +++ b/shopfloor_reception_helpdesk/wizards/stock_helpdesk_ticket_create.py @@ -0,0 +1,15 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockHelpdeskTicketCreate(models.TransientModel): + _inherit = "stock.helpdesk.ticket.create" + + motive_id = fields.Many2one("helpdesk.ticket.motive") + + def _prepare_ticket_values(self) -> dict: + res = super()._prepare_ticket_values() + res["motive_id"] = self.motive_id.id + return res diff --git a/shopfloor_reception_helpdesk_mobile/README.rst b/shopfloor_reception_helpdesk_mobile/README.rst new file mode 100644 index 0000000000..9a8e41007a --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/README.rst @@ -0,0 +1,78 @@ +=================================== +Shopfloor Reception Helpdesk Mobile +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:087d6546b352f6f5da795959a529a648f0c86999d4b7319c73521eb0342a6755 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fwms-lightgray.png?logo=github + :target: https://github.com/OCA/wms/tree/16.0/shopfloor_reception_helpdesk_mobile + :alt: OCA/wms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-shopfloor_reception_helpdesk_mobile + :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/wms&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to define user interface for helpdesk ticket creation +in shopfloor reception flows. + +**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 +------------ + +- Denis Roussel denis.roussel@acsone.eu +- Nicolas Delbovier nicolas.delbovier@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/wms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/shopfloor_reception_helpdesk_mobile/__init__.py b/shopfloor_reception_helpdesk_mobile/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shopfloor_reception_helpdesk_mobile/__manifest__.py b/shopfloor_reception_helpdesk_mobile/__manifest__.py new file mode 100644 index 0000000000..8dff865755 --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopfloor Reception Helpdesk Mobile", + "summary": """This module allows to manage front display for helpdesk + management in reception scenario""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/wms", + "depends": ["shopfloor_reception_helpdesk", "shopfloor_reception_mobile"], + "data": ["templates/assets.xml"], + "demo": [], +} diff --git a/shopfloor_reception_helpdesk_mobile/readme/CONTRIBUTORS.md b/shopfloor_reception_helpdesk_mobile/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..1deb285d76 --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Denis Roussel +- Nicolas Delbovier \ No newline at end of file diff --git a/shopfloor_reception_helpdesk_mobile/readme/DESCRIPTION.md b/shopfloor_reception_helpdesk_mobile/readme/DESCRIPTION.md new file mode 100644 index 0000000000..ef2f5feb82 --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to define user interface for helpdesk ticket creation +in shopfloor reception flows. diff --git a/shopfloor_reception_helpdesk_mobile/static/description/icon.png b/shopfloor_reception_helpdesk_mobile/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/shopfloor_reception_helpdesk_mobile/static/description/icon.png differ diff --git a/shopfloor_reception_helpdesk_mobile/static/description/index.html b/shopfloor_reception_helpdesk_mobile/static/description/index.html new file mode 100644 index 0000000000..191ac4e577 --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/static/description/index.html @@ -0,0 +1,425 @@ + + + + + +Shopfloor Reception Helpdesk Mobile + + + +
+

Shopfloor Reception Helpdesk Mobile

+ + +

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

+

This module allows to define user interface for helpdesk ticket creation +in shopfloor reception flows.

+

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
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/shopfloor_reception_helpdesk_mobile/static/src/scenario/reception.js b/shopfloor_reception_helpdesk_mobile/static/src/scenario/reception.js new file mode 100644 index 0000000000..6e19993bf8 --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/static/src/scenario/reception.js @@ -0,0 +1,105 @@ +/** + * Copyright 2025 ACSONE SA/NV (https://acsone.eu) + * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + */ + +import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js"; + +const reception_scenario = process_registry.get("reception"); +const _get_states = reception_scenario.component.methods._get_states; +// Get the original template of the reception scenario +const template = reception_scenario.component.template; +// And inject the new state template (for this module) into it +const pos = template.indexOf(""); +const new_template = + template.substring(0, pos) + + ` + + + + +` + + template.substring(pos); + +// Extend the reception scenario with : +// - the new patched template +// - the js code for the new state +const ReceptionHelpdesk = process_registry.extend("reception", { + template: new_template, + props: ["helpdesk_description"], + "methods._get_states": function () { + let states = _get_states.bind(this)(); + const set_destination = states.set_destination; + + const self = this; + set_destination.on_declare_helpdesk = function () { + self.wait_call( + self.odoo.call("start_helpdesk", { + picking_id: self.state.data.picking.id, + selected_line_id: self.state.data.selected_move_line[0].id, + }) + ); + }; + + states["start_helpdesk"] = { + on_create_helpdesk: () => { + const motive = self.state.data.helpdesk_wizard.motive; + self.wait_call( + self.odoo.call("create_helpdesk", { + picking_id: self.state.data.picking.id, + selected_line_id: self.state.data.selected_move_line[0].id, + helpdesk_wizard_id: self.state.data.helpdesk_wizard.id, + description: self.state.data.helpdesk_wizard.description, + motive_id: motive ? motive.id : false, + }) + ); + }, + }; + return states; + }, +}); + +process_registry.replace("reception", ReceptionHelpdesk); diff --git a/shopfloor_reception_helpdesk_mobile/templates/assets.xml b/shopfloor_reception_helpdesk_mobile/templates/assets.xml new file mode 100644 index 0000000000..c78352010c --- /dev/null +++ b/shopfloor_reception_helpdesk_mobile/templates/assets.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/test-requirements.txt b/test-requirements.txt index 689482e20d..b8b92498ea 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,4 @@ vcrpy-unittest odoo_test_helper + +odoo-addon-helpdesk-mgmt-stock @ git+https://github.com/OCA/helpdesk@refs/pull/875/head#subdirectory=setup/helpdesk_mgmt_stock