diff --git a/setup/shopfloor_stock_picking_partner_note/odoo/addons/shopfloor_stock_picking_partner_note b/setup/shopfloor_stock_picking_partner_note/odoo/addons/shopfloor_stock_picking_partner_note new file mode 120000 index 0000000000..b67362eeae --- /dev/null +++ b/setup/shopfloor_stock_picking_partner_note/odoo/addons/shopfloor_stock_picking_partner_note @@ -0,0 +1 @@ +../../../../shopfloor_stock_picking_partner_note \ No newline at end of file diff --git a/setup/shopfloor_stock_picking_partner_note/setup.py b/setup/shopfloor_stock_picking_partner_note/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopfloor_stock_picking_partner_note/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopfloor_stock_picking_partner_note/README.rst b/shopfloor_stock_picking_partner_note/README.rst new file mode 100644 index 0000000000..1bfce0fcb2 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/README.rst @@ -0,0 +1,89 @@ +====================== +Shopfloor Packing Info +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5c613b779f18beeb6e4777e4a446034ffe3a8e86142a77e0c68b1338d60c3a11 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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/14.0/shopfloor_packing_info + :alt: OCA/wms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor_packing_info + :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=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds the option to choose predefined messages for the +parameter "Checkout Packing Info", that is set on Customers +and reused in other places, mainly pickings. These new messages +are archived instead of deleted, to keep track of old messages +associated to existing (or archived) Customers. + +The new predefined messages can be created directly in the partner +or in the menu Inventory > Settings > Shopfloor. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**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 +~~~~~~~~~~~~ + +* Carlos Serra-Toro +* Simone Orsi + +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_stock_picking_partner_note/__init__.py b/shopfloor_stock_picking_partner_note/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shopfloor_stock_picking_partner_note/__manifest__.py b/shopfloor_stock_picking_partner_note/__manifest__.py new file mode 100644 index 0000000000..b38ce88471 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2021 Camptocamp SA (https://www.camptocamp.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +{ + "name": "Shopfloor Stock Picking Partner Note", + "summary": "Adapts Shopfloor to Module stock_picking_partner_note", + "version": "14.0.1.0.0", + "development_status": "Alpha", + "category": "Inventory", + "website": "https://github.com/OCA/wms", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "depends": ["shopfloor", "stock_picking_partner_note"], + "data": ["templates/assets.xml"], + "auto_install": True, +} diff --git a/shopfloor_stock_picking_partner_note/readme/CONTRIBUTORS.rst b/shopfloor_stock_picking_partner_note/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..a307f9f7c3 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Juan Miguel Sánchez Arce diff --git a/shopfloor_stock_picking_partner_note/readme/DESCRIPTION.rst b/shopfloor_stock_picking_partner_note/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..fa86bad745 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module is created to integrate the features from stock_picking_partner_note into shopfloor. + +For example, that module makes the stock picking notes computed and stored as an Html field, +which is not compatible with the shopfloor mobile frontend as it expects the notes to be stored as a simple text field. \ No newline at end of file diff --git a/shopfloor_stock_picking_partner_note/static/src/scenario/checkout.js b/shopfloor_stock_picking_partner_note/static/src/scenario/checkout.js new file mode 100644 index 0000000000..34bd1ccc6c --- /dev/null +++ b/shopfloor_stock_picking_partner_note/static/src/scenario/checkout.js @@ -0,0 +1,21 @@ +/** + * Copyright 2024 Camptocamp SA (http://www.camptocamp.com) + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ + +import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js"; + +// stock_picking_partner_note makes the 'note' field in pickings an HTML field, +// which means that we need to display the note as HTML in the shopfloor frontend as well. +const checkout_scenario = process_registry.get("checkout"); +const template = checkout_scenario.component.template; +const new_template = template.replace( + 'v-text="state.data.picking.note"', + 'v-html="state.data.picking.note"' +); + +const CheckoutStockPickingPartnerNote = process_registry.extend("checkout", { + template: new_template, +}); + +process_registry.replace("checkout", CheckoutStockPickingPartnerNote); diff --git a/shopfloor_stock_picking_partner_note/static/src/scenario/cluster_picking.js b/shopfloor_stock_picking_partner_note/static/src/scenario/cluster_picking.js new file mode 100644 index 0000000000..902c654351 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/static/src/scenario/cluster_picking.js @@ -0,0 +1,24 @@ +/** + * Copyright 2024 Camptocamp SA (http://www.camptocamp.com) + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ + +import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js"; + +// stock_picking_partner_note makes the 'note' field in pickings an HTML field, +// which means that we need to display the note as HTML in the shopfloor frontend as well. +const cluster_picking_scenario = process_registry.get("cluster_picking"); +const template = cluster_picking_scenario.component.template; +const new_template = template.replace( + 'v-text="state.data.picking.note"', + 'v-html="state.data.picking.note"' +); + +const ClusterPickingStockPickingPartnerNote = process_registry.extend( + "cluster_picking", + { + template: new_template, + } +); + +process_registry.replace("cluster_picking", ClusterPickingStockPickingPartnerNote); diff --git a/shopfloor_stock_picking_partner_note/templates/assets.xml b/shopfloor_stock_picking_partner_note/templates/assets.xml new file mode 100644 index 0000000000..37015a25c5 --- /dev/null +++ b/shopfloor_stock_picking_partner_note/templates/assets.xml @@ -0,0 +1,31 @@ + + + + + + +