diff --git a/setup/shopfloor_reception_print_label/odoo/addons/shopfloor_reception_print_label b/setup/shopfloor_reception_print_label/odoo/addons/shopfloor_reception_print_label new file mode 120000 index 00000000000..95041733a82 --- /dev/null +++ b/setup/shopfloor_reception_print_label/odoo/addons/shopfloor_reception_print_label @@ -0,0 +1 @@ +../../../../shopfloor_reception_print_label \ No newline at end of file diff --git a/setup/shopfloor_reception_print_label/setup.py b/setup/shopfloor_reception_print_label/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/shopfloor_reception_print_label/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/shopfloor_reception_print_label_mobile/odoo/addons/shopfloor_reception_print_label_mobile b/setup/shopfloor_reception_print_label_mobile/odoo/addons/shopfloor_reception_print_label_mobile new file mode 120000 index 00000000000..386d44a02d8 --- /dev/null +++ b/setup/shopfloor_reception_print_label_mobile/odoo/addons/shopfloor_reception_print_label_mobile @@ -0,0 +1 @@ +../../../../shopfloor_reception_print_label_mobile \ No newline at end of file diff --git a/setup/shopfloor_reception_print_label_mobile/setup.py b/setup/shopfloor_reception_print_label_mobile/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/shopfloor_reception_print_label_mobile/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopfloor_reception_print_label/README.rst b/shopfloor_reception_print_label/README.rst new file mode 100644 index 00000000000..80bccd7e244 --- /dev/null +++ b/shopfloor_reception_print_label/README.rst @@ -0,0 +1,77 @@ +=============================== +Shopfloor Reception Print Label +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c8e48fdbece5a3acf544e887ce968f3efbb79426a8677f7fe58ba2f03ad59897 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_print_label + :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_print_label + :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 be able to print product labels at the end of +reception flow (for one line). + +**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 + +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_print_label/__init__.py b/shopfloor_reception_print_label/__init__.py new file mode 100644 index 00000000000..231ae3a2982 --- /dev/null +++ b/shopfloor_reception_print_label/__init__.py @@ -0,0 +1 @@ +from . import components, services diff --git a/shopfloor_reception_print_label/__manifest__.py b/shopfloor_reception_print_label/__manifest__.py new file mode 100644 index 00000000000..e5cc49797c9 --- /dev/null +++ b/shopfloor_reception_print_label/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2024 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopfloor Reception Print Label", + "summary": """This module allows to print labels during reception flow""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/wms", + "depends": [ + "base_report_to_label_printer", + "shopfloor_reception", + "shopfloor_printing_base", + ], +} diff --git a/shopfloor_reception_print_label/components/__init__.py b/shopfloor_reception_print_label/components/__init__.py new file mode 100644 index 00000000000..672ecddfd01 --- /dev/null +++ b/shopfloor_reception_print_label/components/__init__.py @@ -0,0 +1 @@ +from . import printing diff --git a/shopfloor_reception_print_label/components/printing.py b/shopfloor_reception_print_label/components/printing.py new file mode 100644 index 00000000000..bce2da7a795 --- /dev/null +++ b/shopfloor_reception_print_label/components/printing.py @@ -0,0 +1,12 @@ +# 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 ShopFloorPrintingAction(Component): + """Base Component for actions""" + + _name = "shopfloor.reception.printing.action" + _inherit = "shopfloor.printing.action" + _collection = "shopfloor.printing" + _usage = "reception" diff --git a/shopfloor_reception_print_label/readme/CONTRIBUTORS.md b/shopfloor_reception_print_label/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..4e7e6847269 --- /dev/null +++ b/shopfloor_reception_print_label/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Denis Roussel diff --git a/shopfloor_reception_print_label/readme/DESCRIPTION.md b/shopfloor_reception_print_label/readme/DESCRIPTION.md new file mode 100644 index 00000000000..19a4860fb59 --- /dev/null +++ b/shopfloor_reception_print_label/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to be able to print product labels at the end of reception flow +(for one line). diff --git a/shopfloor_reception_print_label/services/__init__.py b/shopfloor_reception_print_label/services/__init__.py new file mode 100644 index 00000000000..aa19bba8ce4 --- /dev/null +++ b/shopfloor_reception_print_label/services/__init__.py @@ -0,0 +1 @@ +from . import reception diff --git a/shopfloor_reception_print_label/services/reception.py b/shopfloor_reception_print_label/services/reception.py new file mode 100644 index 00000000000..1bbc52c6da0 --- /dev/null +++ b/shopfloor_reception_print_label/services/reception.py @@ -0,0 +1,59 @@ +# Copyright 2025 ACSONE SA/NV (https://acsone.eu) +# 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 + + +class Reception(Component): + _inherit = "shopfloor.reception" + + def print_labels( + self, + picking_id, + selected_line_id, + quantity, + ) -> dict: + """ + Print labels using the printing component. + The report is defined on menu level. + """ + picking = self.env["stock.picking"].browse(picking_id) + selected_line = self.env["stock.move.line"].browse(selected_line_id) + + printing = self._printing_for("reception") + message = printing.print(record_ids=selected_line.ids, quantity=quantity) + return self._response_for_set_destination( + picking, selected_line, message=message + ) + + +class ShopfloorReceptionValidator(Component): + _inherit = "shopfloor.reception.validator" + + def print_labels(self) -> dict: + return { + "picking_id": {"coerce": to_int, "required": True, "type": "integer"}, + "selected_line_id": { + "coerce": to_int, + "required": True, + "type": "integer", + }, + "quantity": { + "coerce": to_int, + "required": True, + "type": "integer", + }, + } + + +class ShopfloorReceptionValidatorResponse(Component): + _inherit = "shopfloor.reception.validator.response" + + def _states(self) -> dict: + res = super()._states() + res.update( + { + "print_labels": self._schema_set_destination, + } + ) + return res diff --git a/shopfloor_reception_print_label/static/description/icon.png b/shopfloor_reception_print_label/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/shopfloor_reception_print_label/static/description/icon.png differ diff --git a/shopfloor_reception_print_label/static/description/index.html b/shopfloor_reception_print_label/static/description/index.html new file mode 100644 index 00000000000..1964ebef51c --- /dev/null +++ b/shopfloor_reception_print_label/static/description/index.html @@ -0,0 +1,424 @@ + + + + + +Shopfloor Reception Print Label + + + +
+

Shopfloor Reception Print Label

+ + +

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

+

This module allows to be able to print product labels at the end of +reception flow (for one line).

+

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_print_label/tests/__init__.py b/shopfloor_reception_print_label/tests/__init__.py new file mode 100644 index 00000000000..ad36f24bfee --- /dev/null +++ b/shopfloor_reception_print_label/tests/__init__.py @@ -0,0 +1 @@ +from . import test_print_label diff --git a/shopfloor_reception_print_label/tests/report.xml b/shopfloor_reception_print_label/tests/report.xml new file mode 100644 index 00000000000..8113335dff9 --- /dev/null +++ b/shopfloor_reception_print_label/tests/report.xml @@ -0,0 +1,22 @@ + + + + + + Test + stock.move.line + qweb-pdf + shopfloor_reception_print_label.report_stock_move_line + shopfloor_reception_print_label.report_stock_move_line + + diff --git a/shopfloor_reception_print_label/tests/test_print_label.py b/shopfloor_reception_print_label/tests/test_print_label.py new file mode 100644 index 00000000000..573bbcce168 --- /dev/null +++ b/shopfloor_reception_print_label/tests/test_print_label.py @@ -0,0 +1,106 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +# pylint: disable=missing-return +from contextlib import contextmanager +from unittest import mock + +from odoo.modules.module import get_resource_path +from odoo.tools import convert_file + +from odoo.addons.base_report_to_printer.models.ir_actions_report import IrActionsReport +from odoo.addons.component.core import WorkContext +from odoo.addons.shopfloor_reception.tests.common import CommonCase + + +class TestSetDestinationPrinting(CommonCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + with cls._work_on_services(cls, menu=cls.menu) as work: + cls.reception = work.component(usage="reception") + + this_module = "shopfloor_reception_print_label" + convert_file( + cls.env.cr, + "shopfloor_reception_print_label", + get_resource_path(this_module, "tests/report.xml"), + {}, + mode="init", + noupdate=False, + kind="test", + ) + + @contextmanager + def _work_on_services(self, collection=None, env=None, **params): + collection = collection or self.shopfloor_app + if env: + collection = collection.with_env(env) + params = params or {} + yield WorkContext( + collection=collection, + # No need for a real request mock + # as we don't deal w/ real request for testing + # but base_rest context provider needs it. + request=mock.Mock(), + **params + ) + + @classmethod + def setUpClassBaseData(cls): + super().setUpClassBaseData() + cls.packing_location.sudo().active = True + cls.location_dest = cls.env.ref("stock.stock_location_stock") + + def test_print_labels(self): + report = self.env.ref("shopfloor_reception_print_label.report_test_document") + self.reception.work.menu.sudo().label_print_report_id = report + picking = self._create_picking() + selected_move_line = picking.move_line_ids.filtered( + lambda l: l.product_id == self.product_a + ) + with mock.patch.object( + IrActionsReport, "print_document_client_action" + ) as mock_print: + mock_print.return_value = True + response = self.reception.dispatch( + "print_labels", + params={ + "picking_id": picking.id, + "selected_line_id": selected_move_line.id, + "quantity": 2, + }, + ) + mock_print.assert_called_once() + message = {"message_type": "success", "body": "Print job sent"} + self.assertEqual( + message, + message | response.get("message"), + ) + + def test_print_labels_error(self): + picking = self._create_picking() + selected_move_line = picking.move_line_ids.filtered( + lambda l: l.product_id == self.product_a + ) + with mock.patch.object( + IrActionsReport, "print_document_client_action" + ) as mock_print: + mock_print.return_value = False + response = self.service.dispatch( + "print_labels", + params={ + "picking_id": picking.id, + "selected_line_id": selected_move_line.id, + "quantity": 2, + }, + ) + mock_print.assert_not_called() + message = { + "message_type": "warning", + "body": "No report found to be printed. Check your scenario menu " + "configuration with your Administrator!", + } + self.assertEqual( + message, + message | response.get("message"), + ) diff --git a/shopfloor_reception_print_label_mobile/README.rst b/shopfloor_reception_print_label_mobile/README.rst new file mode 100644 index 00000000000..caed202b7f2 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/README.rst @@ -0,0 +1,211 @@ +====================================== +Shopfloor Reception Print Label Mobile +====================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d3d39f6e3b96b90b38c9b6385584b122760420c2436f2769f0a64e7b7193a642 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_print_label_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_print_label_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 file must be max 2-3 paragraphs, and is required. + +The goal of this document is to explain quickly the features of this +module: “what” this module does and “what” it is for. ] + +Example: + +This module extends the functionality of ... to support ... and to allow +users to ... + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +[ This file is optional but strongly suggested to allow end-users to +evaluate the module's usefulness in their context. ] + +BUSINESS NEED: It should explain the “why” of the module: + +- what is the business requirement that generated the need to develop + this module +- in which context or use cases this module can be useful (practical + examples are welcome!). + +APPROACH: It could also explain the approach to address the mentioned +need. + +USEFUL INFORMATION: It can also inform on related modules: + +- modules it depends on and their features +- other modules that can work well together with this one +- suggested setups where the module is useful (eg: multicompany, + multi-website) + +Installation +============ + +[ This file must only be present if there are very specific installation +instructions, such as installing non-python dependencies. The audience +is systems administrators. ] + +To install this module, you need to: + +1. Do this ... + +Configuration +============= + +[ This file is not always required; it should explain **how to configure +the module before using it**; it is aimed at users with administration +privileges. + +Please be detailed on the path to configuration (eg: do you need to +activate developer mode?), describe step by step configurations and the +use of screenshots is strongly recommended.] + +To configure this module, you need to: + +- Go to *App* > Menu > Menu item +- Activate boolean… > save +- … + +Usage +===== + +[ This file is required and contains the instructions on **“how”** to +use the module for end-users. + +If the module does not have a visible impact on the user interface, just +add the following sentence: + + This module does not impact the user interface. + +If that’s not the case, please make sure that every usage step is +covered and remember that images speak more than words!] + +To use this module, you need to: + +- Go to *App* > Menu > Menu item + + *insert screenshot!* + +- In “Contact” form, add a value to field *xyz* > save + + *insert screenshot!* + +- The value of *xyz* is now displayed in the list view. + + *insert screenshot!* + +Known issues / Roadmap +====================== + +[ Enumerate known caveats and future potential improvements. It is +mostly intended for end-users, and can also help potential new +contributors discovering new features to implement. ] + +- ... + +Changelog +========= + +[ The change log. The goal of this file is to help readers understand +changes between version. The primary audience is end users and +integrators. Purely technical changes such as code refactoring must not +be mentioned here. + +This file may contain ONE level of section titles, underlined with the ~ +(tilde) character. Other section markers are forbidden and will likely +break the structure of the README.rst or other documents where this +fragment is included. ] + +11.0.x.y.z (YYYY-MM-DD) +----------------------- + +- [BREAKING] Breaking changes come first. + (`#70 `__) +- [ADD] New feature. (`#74 `__) +- [FIX] Correct this. (`#71 `__) + +11.0.x.y.z (YYYY-MM-DD) +----------------------- + +- ... + +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 +------------ + +- Firstname Lastname email.address@example.org (optional company website + url) +- Second Person second.person@example.org (optional company website url) + +Other credits +------------- + +[ This file is optional and contains additional credits, other than +authors, contributors, and maintainers. ] + +The development of this module has been financially supported by: + +- Company 1 name +- Company 2 name + +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_print_label_mobile/__init__.py b/shopfloor_reception_print_label_mobile/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/shopfloor_reception_print_label_mobile/__manifest__.py b/shopfloor_reception_print_label_mobile/__manifest__.py new file mode 100644 index 00000000000..7a50d30c5fb --- /dev/null +++ b/shopfloor_reception_print_label_mobile/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopfloor Reception Print Label Mobile", + "summary": """This module allows to show print button at the end of repcetion 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_mobile_printing_base", + "shopfloor_reception_mobile", + "shopfloor_reception_print_label", + ], + "data": ["templates/assets.xml"], +} diff --git a/shopfloor_reception_print_label_mobile/readme/CONFIGURE.md b/shopfloor_reception_print_label_mobile/readme/CONFIGURE.md new file mode 100644 index 00000000000..2fdb0e64a6f --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/CONFIGURE.md @@ -0,0 +1,10 @@ +[ This file is not always required; it should explain **how to configure the module before using it**; it is aimed at users with administration privileges. + +Please be detailed on the path to configuration (eg: do you need to activate developer mode?), describe step by step configurations and the use of screenshots is strongly recommended.] + + +To configure this module, you need to: + +- Go to *App* > Menu > Menu item +- Activate boolean… > save +- … diff --git a/shopfloor_reception_print_label_mobile/readme/CONTEXT.md b/shopfloor_reception_print_label_mobile/readme/CONTEXT.md new file mode 100644 index 00000000000..096235a2f36 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/CONTEXT.md @@ -0,0 +1,16 @@ +[ This file is optional but strongly suggested to allow end-users to evaluate the +module's usefulness in their context. ] + +BUSINESS NEED: +It should explain the “why” of the module: +- what is the business requirement that generated the need to develop this module +- in which context or use cases this module can be useful (practical examples are welcome!). + +APPROACH: +It could also explain the approach to address the mentioned need. + +USEFUL INFORMATION: +It can also inform on related modules: +- modules it depends on and their features +- other modules that can work well together with this one +- suggested setups where the module is useful (eg: multicompany, multi-website) diff --git a/shopfloor_reception_print_label_mobile/readme/CONTRIBUTORS.md b/shopfloor_reception_print_label_mobile/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..7be72fb967e --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Firstname Lastname (optional company website url) +- Second Person (optional company website url) diff --git a/shopfloor_reception_print_label_mobile/readme/CREDITS.md b/shopfloor_reception_print_label_mobile/readme/CREDITS.md new file mode 100644 index 00000000000..9c2b025b509 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/CREDITS.md @@ -0,0 +1,7 @@ +[ This file is optional and contains additional credits, other than + authors, contributors, and maintainers. ] + +The development of this module has been financially supported by: + +- Company 1 name +- Company 2 name diff --git a/shopfloor_reception_print_label_mobile/readme/DESCRIPTION.md b/shopfloor_reception_print_label_mobile/readme/DESCRIPTION.md new file mode 100644 index 00000000000..2371a1464ae --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +[ This file must be max 2-3 paragraphs, and is required. + +The goal of this document is to explain quickly the features of this module: “what” this module does and “what” it is for. ] + +Example: + +This module extends the functionality of ... to support ... and to allow users to ... diff --git a/shopfloor_reception_print_label_mobile/readme/HISTORY.md b/shopfloor_reception_print_label_mobile/readme/HISTORY.md new file mode 100644 index 00000000000..a6daf58cc9e --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/HISTORY.md @@ -0,0 +1,22 @@ +[ The change log. The goal of this file is to help readers + understand changes between version. The primary audience is + end users and integrators. Purely technical changes such as + code refactoring must not be mentioned here. + + This file may contain ONE level of section titles, underlined + with the ~ (tilde) character. Other section markers are + forbidden and will likely break the structure of the README.rst + or other documents where this fragment is included. ] + +## 11.0.x.y.z (YYYY-MM-DD) + +- [BREAKING] Breaking changes come first. + ([#70](https://github.com/OCA/repo/issues/70)) +- [ADD] New feature. + ([#74](https://github.com/OCA/repo/issues/74)) +- [FIX] Correct this. + ([#71](https://github.com/OCA/repo/issues/71)) + +## 11.0.x.y.z (YYYY-MM-DD) + +- ... diff --git a/shopfloor_reception_print_label_mobile/readme/INSTALL.md b/shopfloor_reception_print_label_mobile/readme/INSTALL.md new file mode 100644 index 00000000000..77b98e7aa22 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/INSTALL.md @@ -0,0 +1,7 @@ +[ This file must only be present if there are very specific + installation instructions, such as installing non-python + dependencies. The audience is systems administrators. ] + +To install this module, you need to: + +1. Do this ... diff --git a/shopfloor_reception_print_label_mobile/readme/ROADMAP.md b/shopfloor_reception_print_label_mobile/readme/ROADMAP.md new file mode 100644 index 00000000000..446840cfb9b --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/ROADMAP.md @@ -0,0 +1,5 @@ +[ Enumerate known caveats and future potential improvements. + It is mostly intended for end-users, and can also help + potential new contributors discovering new features to implement. ] + +- ... diff --git a/shopfloor_reception_print_label_mobile/readme/USAGE.md b/shopfloor_reception_print_label_mobile/readme/USAGE.md new file mode 100644 index 00000000000..2cf127584b0 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/readme/USAGE.md @@ -0,0 +1,21 @@ +[ This file is required and contains the instructions on **“how”** to use the module for end-users. + +If the module does not have a visible impact on the user interface, just add the following sentence: + +> This module does not impact the user interface. + +If that’s not the case, please make sure that every usage step is covered and remember that images speak more than words!] + +To use this module, you need to: + +- Go to *App* > Menu > Menu item + + *insert screenshot!* + +- In “Contact” form, add a value to field *xyz* > save + + *insert screenshot!* + +- The value of *xyz* is now displayed in the list view. + + *insert screenshot!* diff --git a/shopfloor_reception_print_label_mobile/static/description/icon.png b/shopfloor_reception_print_label_mobile/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/shopfloor_reception_print_label_mobile/static/description/icon.png differ diff --git a/shopfloor_reception_print_label_mobile/static/description/index.html b/shopfloor_reception_print_label_mobile/static/description/index.html new file mode 100644 index 00000000000..7bdf6fcdf6f --- /dev/null +++ b/shopfloor_reception_print_label_mobile/static/description/index.html @@ -0,0 +1,555 @@ + + + + + +Shopfloor Reception Print Label Mobile + + + +
+

Shopfloor Reception Print Label Mobile

+ + +

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

+

[ This file must be max 2-3 paragraphs, and is required.

+

The goal of this document is to explain quickly the features of this +module: “what” this module does and “what” it is for. ]

+

Example:

+

This module extends the functionality of … to support … and to allow +users to …

+

Table of contents

+ +
+

Use Cases / Context

+

[ This file is optional but strongly suggested to allow end-users to +evaluate the module’s usefulness in their context. ]

+

BUSINESS NEED: It should explain the “why” of the module:

+
    +
  • what is the business requirement that generated the need to develop +this module
  • +
  • in which context or use cases this module can be useful (practical +examples are welcome!).
  • +
+

APPROACH: It could also explain the approach to address the mentioned +need.

+

USEFUL INFORMATION: It can also inform on related modules:

+
    +
  • modules it depends on and their features
  • +
  • other modules that can work well together with this one
  • +
  • suggested setups where the module is useful (eg: multicompany, +multi-website)
  • +
+
+
+

Installation

+

[ This file must only be present if there are very specific installation +instructions, such as installing non-python dependencies. The audience +is systems administrators. ]

+

To install this module, you need to:

+
    +
  1. Do this …
  2. +
+
+
+

Configuration

+

[ This file is not always required; it should explain how to configure +the module before using it; it is aimed at users with administration +privileges.

+

Please be detailed on the path to configuration (eg: do you need to +activate developer mode?), describe step by step configurations and the +use of screenshots is strongly recommended.]

+

To configure this module, you need to:

+
    +
  • Go to App > Menu > Menu item
  • +
  • Activate boolean… > save
  • +
  • +
+
+
+

Usage

+

[ This file is required and contains the instructions on “how” to +use the module for end-users.

+

If the module does not have a visible impact on the user interface, just +add the following sentence:

+
+This module does not impact the user interface.
+

If that’s not the case, please make sure that every usage step is +covered and remember that images speak more than words!]

+

To use this module, you need to:

+
    +
  • Go to App > Menu > Menu item

    +

    insert screenshot!

    +
  • +
  • In “Contact” form, add a value to field xyz > save

    +

    insert screenshot!

    +
  • +
  • The value of xyz is now displayed in the list view.

    +

    insert screenshot!

    +
  • +
+
+
+

Known issues / Roadmap

+

[ Enumerate known caveats and future potential improvements. It is +mostly intended for end-users, and can also help potential new +contributors discovering new features to implement. ]

+
    +
  • +
+
+
+

Changelog

+

[ The change log. The goal of this file is to help readers understand +changes between version. The primary audience is end users and +integrators. Purely technical changes such as code refactoring must not +be mentioned here.

+

This file may contain ONE level of section titles, underlined with the ~ +(tilde) character. Other section markers are forbidden and will likely +break the structure of the README.rst or other documents where this +fragment is included. ]

+
+

11.0.x.y.z (YYYY-MM-DD)

+
    +
  • [BREAKING] Breaking changes come first. +(#70)
  • +
  • [ADD] New feature. (#74)
  • +
  • [FIX] Correct this. (#71)
  • +
+
+ +
+
+

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

+ +
+
+

Other credits

+

[ This file is optional and contains additional credits, other than +authors, contributors, and maintainers. ]

+

The development of this module has been financially supported by:

+
    +
  • Company 1 name
  • +
  • Company 2 name
  • +
+
+
+

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_print_label_mobile/static/src/scenario/reception.js b/shopfloor_reception_print_label_mobile/static/src/scenario/reception.js new file mode 100644 index 00000000000..ff3a27a23e4 --- /dev/null +++ b/shopfloor_reception_print_label_mobile/static/src/scenario/reception.js @@ -0,0 +1,50 @@ +/** + * Copyright 2023 Camptocamp SA (http://www.camptocamp.com) + * 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 ReceptionProductBarcode = process_registry.extend("reception", { + template: new_template, + "methods._get_states": function () { + let states = _get_states.bind(this)(); + const set_destination = states.set_destination; + + const self = this; + set_destination.print_labels = function (quantity) { + self.wait_call( + self.odoo.call("print_labels", { + picking_id: self.state.data.picking.id, + selected_line_id: self.state.data.selected_move_line[0].id, + quantity: quantity, + }) + ); + }; + return states; + }, +}); + +process_registry.replace("reception", ReceptionProductBarcode); diff --git a/shopfloor_reception_print_label_mobile/templates/assets.xml b/shopfloor_reception_print_label_mobile/templates/assets.xml new file mode 100644 index 00000000000..8fde6a3fddb --- /dev/null +++ b/shopfloor_reception_print_label_mobile/templates/assets.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt index 689482e20df..5a775e3fba0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,5 @@ vcrpy-unittest odoo_test_helper + +odoo-addon-shopfloor-printing-base @ git+https://github.com/OCA/wms@refs/pull/1085/head#subdirectory=setup/shopfloor_printing_base +odoo-addon-shopfloor-mobile-printing-base @ git+https://github.com/OCA/wms@refs/pull/1085/head#subdirectory=setup/shopfloor_mobile_printing_base