diff --git a/setup/shopfloor_reception_packaging_dimension/odoo/addons/shopfloor_reception_packaging_dimension b/setup/shopfloor_reception_packaging_dimension/odoo/addons/shopfloor_reception_packaging_dimension new file mode 120000 index 00000000000..9ff2c52e7ae --- /dev/null +++ b/setup/shopfloor_reception_packaging_dimension/odoo/addons/shopfloor_reception_packaging_dimension @@ -0,0 +1 @@ +../../../../shopfloor_reception_packaging_dimension \ No newline at end of file diff --git a/setup/shopfloor_reception_packaging_dimension/setup.py b/setup/shopfloor_reception_packaging_dimension/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/shopfloor_reception_packaging_dimension/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/shopfloor_reception_packaging_dimension_mobile/odoo/addons/shopfloor_reception_packaging_dimension_mobile b/setup/shopfloor_reception_packaging_dimension_mobile/odoo/addons/shopfloor_reception_packaging_dimension_mobile new file mode 120000 index 00000000000..a9ab8c21f8f --- /dev/null +++ b/setup/shopfloor_reception_packaging_dimension_mobile/odoo/addons/shopfloor_reception_packaging_dimension_mobile @@ -0,0 +1 @@ +../../../../shopfloor_reception_packaging_dimension_mobile \ No newline at end of file diff --git a/setup/shopfloor_reception_packaging_dimension_mobile/setup.py b/setup/shopfloor_reception_packaging_dimension_mobile/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/shopfloor_reception_packaging_dimension_mobile/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopfloor_reception_packaging_dimension/README.rst b/shopfloor_reception_packaging_dimension/README.rst new file mode 100644 index 00000000000..9ad7f5dc789 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/README.rst @@ -0,0 +1,89 @@ +======================================= +Shopfloor Reception Packaging Dimension +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9eeb40e76db899eedaf247b7f44f8ccb3222db15482d93d6f80b64e27fdfd2a6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_packaging_dimension + :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_packaging_dimension + :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 adds an option to the reception scenario. When activated. +Before setting the quantity for the reception, if there is product +packaging related to the product received with missing information, the +user will be presented with a screen (for each packaging) proposing to +update the missing information. + +**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 +------------ + +- Thierry Ducrest +- Denis Roussel + +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. + +.. |maintainer-TDu| image:: https://github.com/TDu.png?size=40px + :target: https://github.com/TDu + :alt: TDu + +Current `maintainer `__: + +|maintainer-TDu| + +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_packaging_dimension/__init__.py b/shopfloor_reception_packaging_dimension/__init__.py new file mode 100644 index 00000000000..e7386302bbe --- /dev/null +++ b/shopfloor_reception_packaging_dimension/__init__.py @@ -0,0 +1,3 @@ +from .hooks import post_init_hook, uninstall_hook +from . import models +from . import services diff --git a/shopfloor_reception_packaging_dimension/__manifest__.py b/shopfloor_reception_packaging_dimension/__manifest__.py new file mode 100644 index 00000000000..ea28dc77e86 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "Shopfloor Reception Packaging Dimension", + "summary": "Collect Packaging Dimension from the Reception scenario", + "version": "16.0.1.0.0", + "development_status": "Beta", + "category": "Inventory", + "website": "https://github.com/OCA/wms", + "author": "Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["TDu"], + "license": "AGPL-3", + "installable": True, + "depends": ["shopfloor_reception", "product_packaging_level"], + "data": [ + "views/product_packaging_level.xml", + "views/shopfloor_menu.xml", + ], + "post_init_hook": "post_init_hook", + "uninstall_hook": "uninstall_hook", +} diff --git a/shopfloor_reception_packaging_dimension/hooks.py b/shopfloor_reception_packaging_dimension/hooks.py new file mode 100644 index 00000000000..763dee221f3 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/hooks.py @@ -0,0 +1,40 @@ +# Copyright 2023 Camptocamp SA (http://www.camptocamp.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import json +import logging + +from odoo import SUPERUSER_ID, api + +from odoo.addons.shopfloor_base.utils import purge_endpoints, register_new_services + +from .services.reception import Reception as Service + +_logger = logging.getLogger(__file__) + + +def post_init_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + _logger.info("Add set packaging dimension option on reception scenario") + scenario = env.ref("shopfloor_reception.scenario_reception") + options = scenario.options + options.update({"set_packaging_dimension": True}) + scenario.options_edit = json.dumps(options) + # The service imported is extending an existing component + # As it is a simple python import the odoo inheritance is not working + # So it needs to be fix + Service._usage = "reception" + Service._name = "shopfloor.reception" + register_new_services(env, Service) + + +def uninstall_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + _logger.info("Remove set packaging dimension option on reception scenario") + scenario = env.ref("shopfloor_reception.scenario_reception") + options = scenario.options + if "set_packaging_dimension" in options.keys(): + options.pop("set_packaging_dimension") + scenario.options_edit = json.dumps(options) + Service._usage = "reception" + purge_endpoints(env, Service._usage, endpoint="set_packaging_dimension") diff --git a/shopfloor_reception_packaging_dimension/i18n/it.po b/shopfloor_reception_packaging_dimension/i18n/it.po new file mode 100644 index 00000000000..2ba3659a928 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/i18n/it.po @@ -0,0 +1,92 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * shopfloor_reception_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-09-01 09:42+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_height +msgid "Collect height" +msgstr "Raccogli altezza" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_length +msgid "Collect length" +msgstr "Raccogli lunghezza" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_weight +msgid "Collect weight" +msgstr "Raccogli peso" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_width +msgid "Collect width" +msgstr "Raccogli larghezza" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension +msgid "" +"If for the product being processed, its related packaging dimension are not " +"set, ask to fill them up." +msgstr "" +"Se per il prodotto che deve essere lavorato, non è impostata la dimensione " +"dell'imballo, chiede di compilarla." + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_product_packaging_level +msgid "Level management for product.packaging" +msgstr "Gestione livello per product.packaging" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu +msgid "Menu displayed in the scanner application" +msgstr "Menu visualizzato nell'applicazione di scansione" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension_is_possible +msgid "Set Packaging Dimension Is Possible" +msgstr "È possibile impostare la dimensione dell'imballo" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension +msgid "Set packaging dimension" +msgstr "Imposta dimensione imballo" + +#. module: shopfloor_reception_packaging_dimension +#: model_terms:ir.ui.view,arch_db:shopfloor_reception_packaging_dimension.view_product_packaging_level_form +msgid "Shopfloor" +msgstr "Reparto" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_height +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_length +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_weight +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_width +msgid "" +"When marked, shopfloor will require to set this dimension during reception " +"if undefined on the packaging" +msgstr "" +"Una volta contrassegnata, il reparto dovrà impostare questa dimensione " +"durante la ricezione se non definita sulla confezione" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/shopfloor_reception_packaging_dimension/i18n/shopfloor_reception_packaging_dimension.pot b/shopfloor_reception_packaging_dimension/i18n/shopfloor_reception_packaging_dimension.pot new file mode 100644 index 00000000000..bedc200b543 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/i18n/shopfloor_reception_packaging_dimension.pot @@ -0,0 +1,76 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * shopfloor_reception_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_height +msgid "Collect height" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_length +msgid "Collect length" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_weight +msgid "Collect weight" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_width +msgid "Collect width" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension +msgid "" +"If for the product being processed, its related packaging dimension are not " +"set, ask to fill them up." +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_product_packaging_level +msgid "Level management for product.packaging" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu +msgid "Menu displayed in the scanner application" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension_is_possible +msgid "Set Packaging Dimension Is Possible" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension +msgid "Set packaging dimension" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model_terms:ir.ui.view,arch_db:shopfloor_reception_packaging_dimension.view_product_packaging_level_form +msgid "Shopfloor" +msgstr "" + +#. module: shopfloor_reception_packaging_dimension +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_height +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_length +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_weight +#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_product_packaging_level__shopfloor_collect_width +msgid "" +"When marked, shopfloor will require to set this dimension during reception " +"if undefined on the packaging" +msgstr "" diff --git a/shopfloor_reception_packaging_dimension/models/__init__.py b/shopfloor_reception_packaging_dimension/models/__init__.py new file mode 100644 index 00000000000..0f96d1da6bd --- /dev/null +++ b/shopfloor_reception_packaging_dimension/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_packaging_level +from . import shopfloor_menu diff --git a/shopfloor_reception_packaging_dimension/models/product_packaging_level.py b/shopfloor_reception_packaging_dimension/models/product_packaging_level.py new file mode 100644 index 00000000000..f766f5be621 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/models/product_packaging_level.py @@ -0,0 +1,33 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo import fields, models + +HELP_TEXT = ( + "When marked, shopfloor will require to set this dimension during " + "reception if undefined on the packaging" +) + + +class ProductPackagingLevel(models.Model): + _inherit = "product.packaging.level" + + shopfloor_collect_length = fields.Boolean( + "Collect length", + default=True, + help=HELP_TEXT, + ) + shopfloor_collect_width = fields.Boolean( + "Collect width", + default=True, + help=HELP_TEXT, + ) + shopfloor_collect_height = fields.Boolean( + "Collect height", + default=True, + help=HELP_TEXT, + ) + shopfloor_collect_weight = fields.Boolean( + "Collect weight", + default=True, + help=HELP_TEXT, + ) diff --git a/shopfloor_reception_packaging_dimension/models/shopfloor_menu.py b/shopfloor_reception_packaging_dimension/models/shopfloor_menu.py new file mode 100644 index 00000000000..6cf71a58de0 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/models/shopfloor_menu.py @@ -0,0 +1,24 @@ +# Copyright 2023 Camptocamp SA (http://www.camptocamp.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class ShopfloorMenu(models.Model): + _inherit = "shopfloor.menu" + + set_packaging_dimension_is_possible = fields.Boolean( + compute="_compute_set_packaging_dimension_is_possible" + ) + set_packaging_dimension = fields.Boolean( + string="Set packaging dimension", + default=False, + help="If for the product being processed, its related packaging " + "dimension are not set, ask to fill them up.", + ) + + @api.depends("scenario_id") + def _compute_set_packaging_dimension_is_possible(self): + for menu in self: + menu.set_packaging_dimension_is_possible = menu.scenario_id.has_option( + "set_packaging_dimension" + ) diff --git a/shopfloor_reception_packaging_dimension/pyproject.toml b/shopfloor_reception_packaging_dimension/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/shopfloor_reception_packaging_dimension/readme/CONTRIBUTORS.md b/shopfloor_reception_packaging_dimension/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..e3bb8b0f9b7 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Thierry Ducrest \<\> +- Denis Roussel \<\> \ No newline at end of file diff --git a/shopfloor_reception_packaging_dimension/readme/DESCRIPTION.md b/shopfloor_reception_packaging_dimension/readme/DESCRIPTION.md new file mode 100644 index 00000000000..7486f8c5859 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +This module adds an option to the reception scenario. When activated. +Before setting the quantity for the reception, if there is product +packaging related to the product received with missing information, the +user will be presented with a screen (for each packaging) proposing to +update the missing information. diff --git a/shopfloor_reception_packaging_dimension/services/__init__.py b/shopfloor_reception_packaging_dimension/services/__init__.py new file mode 100644 index 00000000000..aa19bba8ce4 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/services/__init__.py @@ -0,0 +1 @@ +from . import reception diff --git a/shopfloor_reception_packaging_dimension/services/reception.py b/shopfloor_reception_packaging_dimension/services/reception.py new file mode 100644 index 00000000000..695c6d0b8d8 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/services/reception.py @@ -0,0 +1,228 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo.osv import expression + +from odoo.addons.base_rest.components.service import to_int +from odoo.addons.component.core import Component +from odoo.addons.shopfloor.utils import to_float + + +class Reception(Component): + _inherit = "shopfloor.reception" + + def __init__(self, work_context): + super().__init__(work_context) + self.packaging_update_done = False + + def _before_state__set_quantity(self, picking, line, message=None): + """Show the packaging dimension screen before the set quantity screen.""" + if self.work.menu.set_packaging_dimension and not self.packaging_update_done: + packaging = self._get_next_packaging_to_set_dimension(line.product_id) + if packaging: + return self._response_for_set_packaging_dimension( + picking, line, packaging, message=message + ) + return super()._before_state__set_quantity(picking, line, message=message) + + def _get_domain_packaging_needs_dimension(self): + return expression.OR( + [ + [ + ("packaging_level_id.shopfloor_collect_length", "=", True), + "|", + ("packaging_length", "=", 0), + ("packaging_length", "=", False), + ], + [ + ("packaging_level_id.shopfloor_collect_width", "=", True), + "|", + ("width", "=", 0), + ("width", "=", False), + ], + [ + ("packaging_level_id.shopfloor_collect_height", "=", True), + "|", + ("height", "=", 0), + ("height", "=", False), + ], + [ + ("packaging_level_id.shopfloor_collect_weight", "=", True), + "|", + ("weight", "=", 0), + ("weight", "=", False), + ], + [("barcode", "=", False)], + ] + ) + + def _get_next_packaging_to_set_dimension(self, product, previous_packaging=None): + """Return for a product the next packaging needing dimension to be set.""" + next_packaging_id = previous_packaging.id + 1 if previous_packaging else 0 + domain_dimension = self._get_domain_packaging_needs_dimension() + domain_packaging_id = [ + ("product_id", "=", product.id), + ("id", ">=", next_packaging_id), + ] + domain = expression.AND([domain_packaging_id, domain_dimension]) + return self.env["product.packaging"].search(domain, order="id", limit=1) + + def _response_for_set_packaging_dimension( + self, picking, line, packaging, message=None + ): + return self._response( + next_state="set_packaging_dimension", + data={ + "picking": self.data.picking(picking), + "selected_move_line": self.data.move_line(line), + "packaging": self._set_packaging_dimension_data_for_packaging( + packaging + ), + }, + message=message, + ) + + def _set_packaging_dimension_data_for_packaging(self, packaging): + return self.data_detail.packaging_detail(packaging) + + def set_packaging_dimension( + self, picking_id, selected_line_id, packaging_id, cancel=False, **kwargs + ): + """Set the dimension on a product packaging. + + If the user cancel the dimension update we still propose the next + possible packaging. + + Transitions: + - set_packaging_dimension: if more packaging needs dimension + - set_quantity: otherwise + """ + picking = self.env["stock.picking"].browse(picking_id) + selected_line = self.env["stock.move.line"].browse(selected_line_id) + packaging = self.env["product.packaging"].sudo().browse(packaging_id) + message = None + next_packaging = None + if not packaging: + message = self.msg_store.record_not_found() + elif not cancel and self._check_dimension_to_update(kwargs): + self._update_packaging_dimension(packaging, kwargs) + message = self.msg_store.packaging_dimension_updated(packaging) + if packaging: + next_packaging = self._get_next_packaging_to_set_dimension( + selected_line.product_id, packaging + ) + if next_packaging: + return self._response_for_set_packaging_dimension( + picking, selected_line, next_packaging, message=message + ) + self.packaging_update_done = True + return self._before_state__set_quantity(picking, selected_line, message=message) + + def _check_dimension_to_update(self, dimensions): + """Return True if any dimension on the packaging needs to be updated""" + return any([value is not None for key, value in dimensions.items()]) + + def _get_dimension_fields_conversion_map(self): + return {"length": "packaging_length"} + + def _update_packaging_dimension(self, packaging, dimensions_to_update): + """Update dimension on the packaging.""" + fields_conv_map = self._get_dimension_fields_conversion_map() + for dimension, value in dimensions_to_update.items(): + if value is not None: + dimension = fields_conv_map.get(dimension, dimension) + packaging[dimension] = value + + +class ShopfloorReceptionValidator(Component): + _inherit = "shopfloor.reception.validator" + + def set_packaging_dimension(self): + return { + "picking_id": {"coerce": to_int, "required": True, "type": "integer"}, + "selected_line_id": { + "coerce": to_int, + "required": True, + "type": "integer", + }, + "packaging_id": {"coerce": to_int, "required": True, "type": "integer"}, + "height": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "length": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "width": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "weight": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "shipping_weight": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "qty": { + "coerce": to_float, + "required": False, + "type": "float", + "nullable": True, + }, + "barcode": {"type": "string", "required": False, "nullable": True}, + "cancel": {"type": "boolean"}, + } + + +class ShopfloorReceptionValidatorResponse(Component): + _inherit = "shopfloor.reception.validator.response" + + def _states(self): + res = super()._states() + res.update({"set_packaging_dimension": self._schema_set_packaging_dimension}) + return res + + def _scan_line_next_states(self): + res = super()._scan_line_next_states() + res.update({"set_packaging_dimension"}) + return res + + def _set_lot_confirm_action_next_states(self): + res = super()._set_lot_confirm_action_next_states() + res.update({"set_packaging_dimension"}) + return res + + @property + def _schema_set_packaging_dimension(self): + return { + "picking": {"type": "dict", "schema": self.schemas.picking()}, + "selected_move_line": {"type": "dict", "schema": self.schemas.move_line()}, + "packaging": self._schema_packaging(), + } + + def _schema_packaging(self): + return { + "type": "dict", + "schema": self.schemas_detail.packaging_detail(), + } + + def _set_packaging_dimension_next_states(self): + return {"set_packaging_dimension", "set_quantity"} + + def set_packaging_dimension(self): + return self._response_schema( + next_states=self._set_packaging_dimension_next_states() + ) diff --git a/shopfloor_reception_packaging_dimension/static/description/icon.png b/shopfloor_reception_packaging_dimension/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/shopfloor_reception_packaging_dimension/static/description/icon.png differ diff --git a/shopfloor_reception_packaging_dimension/static/description/index.html b/shopfloor_reception_packaging_dimension/static/description/index.html new file mode 100644 index 00000000000..84e2fae6a45 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +Shopfloor Reception Packaging Dimension + + + +
+

Shopfloor Reception Packaging Dimension

+ + +

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

+

This module adds an option to the reception scenario. When activated. +Before setting the quantity for the reception, if there is product +packaging related to the product received with missing information, the +user will be presented with a screen (for each packaging) proposing to +update the missing information.

+

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.

+

Current maintainer:

+

TDu

+

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_packaging_dimension/tests/__init__.py b/shopfloor_reception_packaging_dimension/tests/__init__.py new file mode 100644 index 00000000000..2c166ca4fd7 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/tests/__init__.py @@ -0,0 +1 @@ +from . import test_set_package_dimension diff --git a/shopfloor_reception_packaging_dimension/tests/test_set_package_dimension.py b/shopfloor_reception_packaging_dimension/tests/test_set_package_dimension.py new file mode 100644 index 00000000000..d797f6b4c03 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/tests/test_set_package_dimension.py @@ -0,0 +1,233 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo.addons.shopfloor_reception.tests.common import CommonCase + + +# pylint: disable=W8110 +class TestSetPackDimension(CommonCase): + @classmethod + def setUpClassBaseData(cls): + super().setUpClassBaseData() + # Activate the option to use the module + cls.menu.sudo().set_packaging_dimension = True + cls.picking = cls._create_picking( + lines=[(cls.product_a, 10), (cls.product_b, 10), (cls.product_c, 10)] + ) + cls.default_packaging_level = cls.env[ + "product.packaging" + ].default_packaging_level_id() + cls.default_packaging_level.sudo().write( + { + "shopfloor_collect_length": True, + "shopfloor_collect_width": True, + "shopfloor_collect_height": True, + "shopfloor_collect_weight": True, + } + ) + # Picking has 3 products + # Product A with one packaging + # Product B with no packaging + cls.product_b.packaging_ids = [(5, 0, 0)] + # Product C with 2 packaging + cls.product_c_packaging_2 = ( + cls.env["product.packaging"] + .sudo() + .create( + { + "name": "Big Box", + "product_id": cls.product_c.id, + "barcode": "ProductCBigBox", + "qty": 6, + } + ) + ) + + cls.line_with_packaging = cls.picking.move_line_ids[0] + cls.line_without_packaging = cls.picking.move_line_ids[1] + + def _assert_response_set_dimension( + self, response, picking, line, packaging, message=None + ): + data = { + "picking": self.data.picking(picking), + "selected_move_line": self.data.move_line(line), + "packaging": self.data_detail.packaging_detail(packaging), + } + self.assert_response( + response, + next_state="set_packaging_dimension", + data=data, + message=message, + ) + + def test_scan_product_ask_for_dimension(self): + self.product_a.tracking = "none" + # self._add_package(self.picking) + self.assertTrue(self.product_a.packaging_ids) + response = self.service.dispatch( + "scan_line", + params={ + "picking_id": self.picking.id, + "barcode": self.product_a.barcode, + }, + ) + self.data.picking(self.picking) + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self._assert_response_set_dimension( + response, self.picking, selected_move_line, self.product_a_packaging + ) + + def test_scan_product_dimension_already_defined(self): + self.product_a.tracking = "none" + self.product_a_packaging.write( + { + "packaging_length": 10.0, + "width": 5.0, + "height": 2.0, + "weight": 1.5, + } + ) + response = self.service.dispatch( + "scan_line", + params={ + "picking_id": self.picking.id, + "barcode": self.product_a.barcode, + }, + ) + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self.assert_response( + response, + next_state="set_quantity", + data={ + "confirmation_required": None, + "picking": self.data.picking(self.picking), + "selected_move_line": [self.data.move_line(selected_move_line)], + }, + ) + + def test_scan_product_dimension_not_needed(self): + self.product_a.tracking = "none" + self.default_packaging_level.sudo().write( + { + "shopfloor_collect_length": False, + "shopfloor_collect_width": False, + "shopfloor_collect_height": False, + "shopfloor_collect_weight": False, + } + ) + response = self.service.dispatch( + "scan_line", + params={ + "picking_id": self.picking.id, + "barcode": self.product_a.barcode, + }, + ) + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self.assert_response( + response, + next_state="set_quantity", + data={ + "confirmation_required": None, + "picking": self.data.picking(self.picking), + "selected_move_line": [self.data.move_line(selected_move_line)], + }, + ) + + def test_scan_lot_ask_for_dimension(self): + self.product_a.tracking = "none" + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self.assertTrue(self.product_a.packaging_ids) + response = self.service.dispatch( + "set_lot_confirm_action", + params={ + "picking_id": self.picking.id, + "selected_line_id": selected_move_line.id, + }, + ) + self.data.picking(self.picking) + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self._assert_response_set_dimension( + response, self.picking, selected_move_line, self.product_a_packaging + ) + + def test_set_packaging_dimension(self): + selected_move_line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_a + ) + self.service.dispatch( + "set_packaging_dimension", + params={ + "picking_id": self.picking.id, + "selected_line_id": selected_move_line.id, + "packaging_id": self.product_a_packaging.id, + "height": 55, + "qty": 34, + "barcode": "barcode", + }, + ) + self.assertEqual(self.product_a_packaging.height, 55) + self.assertEqual(self.product_a_packaging.barcode, "barcode") + self.assertEqual(self.product_a_packaging.qty, 34) + + def test_set_multiple_packaging_dimension(self): + line = self.picking.move_line_ids.filtered( + lambda li: li.product_id == self.product_c + ) + # Set the weight but other dimension are required + self.product_c_packaging_2.weight = 200 + response = self.service.dispatch( + "set_packaging_dimension", + params={ + "picking_id": self.picking.id, + "selected_line_id": line.id, + "packaging_id": self.product_c_packaging.id, + "height": 55, + "length": 233, + }, + ) + self.assertEqual(self.product_c_packaging.height, 55) + self.assertEqual(self.product_c_packaging.packaging_length, 233) + self._assert_response_set_dimension( + response, + self.picking, + line, + self.product_c_packaging_2, + message=self.msg_store.packaging_dimension_updated( + self.product_c_packaging + ), + ) + response = self.service.dispatch( + "set_packaging_dimension", + params={ + "picking_id": self.picking.id, + "selected_line_id": line.id, + "packaging_id": self.product_c_packaging_2.id, + "height": 200, + "weight": 1000, + }, + ) + self.assertEqual(self.product_c_packaging_2.height, 200) + self.assertEqual(self.product_c_packaging_2.weight, 1000) + self.assert_response( + response, + next_state="set_quantity", + data={ + "picking": self.data.picking(self.picking), + "selected_move_line": self.data.move_lines(line), + "confirmation_required": None, + }, + message=self.msg_store.packaging_dimension_updated( + self.product_c_packaging_2 + ), + ) diff --git a/shopfloor_reception_packaging_dimension/views/product_packaging_level.xml b/shopfloor_reception_packaging_dimension/views/product_packaging_level.xml new file mode 100644 index 00000000000..93950b5f655 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/views/product_packaging_level.xml @@ -0,0 +1,23 @@ + + + + product.packaging.level.form + product.packaging.level + + + + + + + + + + + + + + + diff --git a/shopfloor_reception_packaging_dimension/views/shopfloor_menu.xml b/shopfloor_reception_packaging_dimension/views/shopfloor_menu.xml new file mode 100644 index 00000000000..42c46d55a28 --- /dev/null +++ b/shopfloor_reception_packaging_dimension/views/shopfloor_menu.xml @@ -0,0 +1,18 @@ + + + + shopfloor.menu + + + + + + + + + + + diff --git a/shopfloor_reception_packaging_dimension_mobile/README.rst b/shopfloor_reception_packaging_dimension_mobile/README.rst new file mode 100644 index 00000000000..61ce5c6b1f0 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/README.rst @@ -0,0 +1,88 @@ +============================================== +Shopfloor Reception Packaging Dimension Mobile +============================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:0a022165b9c574559c392b7d2b419b9c0373bc82fc777cc497f937a75738af1a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_packaging_dimension_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_packaging_dimension_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 adds the front end part for the `shopfloor_reception_packaging_dimension` +module. Allowing to set dimension on packaging related to the product being processed, +if they are not set already. +The option needs to be enable on the shopfloor menu. + +**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 +~~~~~~~~~~~~ + +* Thierry Ducrest +* Denis Roussel + +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. + +.. |maintainer-TDu| image:: https://github.com/TDu.png?size=40px + :target: https://github.com/TDu + :alt: TDu + +Current `maintainer `__: + +|maintainer-TDu| + +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_packaging_dimension_mobile/__init__.py b/shopfloor_reception_packaging_dimension_mobile/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/shopfloor_reception_packaging_dimension_mobile/__manifest__.py b/shopfloor_reception_packaging_dimension_mobile/__manifest__.py new file mode 100644 index 00000000000..0fbd8188128 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Shopfloor Reception Packaging Dimension Mobile", + "summary": "Frontend for the packaging dimension on reception scenario", + "version": "16.0.1.0.0", + "category": "Inventory", + "website": "https://github.com/OCA/wms", + "author": "Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["TDu"], + "license": "AGPL-3", + "depends": [ + "shopfloor_reception_mobile", + "shopfloor_reception_packaging_dimension", + ], + "data": ["templates/assets.xml"], +} diff --git a/shopfloor_reception_packaging_dimension_mobile/i18n/it.po b/shopfloor_reception_packaging_dimension_mobile/i18n/it.po new file mode 100644 index 00000000000..9ce4346f63e --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" diff --git a/shopfloor_reception_packaging_dimension_mobile/i18n/shopfloor_reception_packaging_dimension_mobile.pot b/shopfloor_reception_packaging_dimension_mobile/i18n/shopfloor_reception_packaging_dimension_mobile.pot new file mode 100644 index 00000000000..4d8b20f912f --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/i18n/shopfloor_reception_packaging_dimension_mobile.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/shopfloor_reception_packaging_dimension_mobile/readme/CONTRIBUTORS.rst b/shopfloor_reception_packaging_dimension_mobile/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..9dda9dc4be2 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Thierry Ducrest +* Denis Roussel diff --git a/shopfloor_reception_packaging_dimension_mobile/readme/DESCRIPTION.rst b/shopfloor_reception_packaging_dimension_mobile/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..ab7978b5619 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module adds the front end part for the `shopfloor_reception_packaging_dimension` +module. Allowing to set dimension on packaging related to the product being processed, +if they are not set already. +The option needs to be enable on the shopfloor menu. diff --git a/shopfloor_reception_packaging_dimension_mobile/static/description/icon.png b/shopfloor_reception_packaging_dimension_mobile/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/shopfloor_reception_packaging_dimension_mobile/static/description/icon.png differ diff --git a/shopfloor_reception_packaging_dimension_mobile/static/description/index.html b/shopfloor_reception_packaging_dimension_mobile/static/description/index.html new file mode 100644 index 00000000000..6b74bc7bd66 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +Shopfloor Reception Packaging Dimension Mobile + + + +
+

Shopfloor Reception Packaging Dimension Mobile

+ + +

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

+

This module adds the front end part for the shopfloor_reception_packaging_dimension +module. Allowing to set dimension on packaging related to the product being processed, +if they are not set already. +The option needs to be enable on the shopfloor menu.

+

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.

+

Current maintainer:

+

TDu

+

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_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js b/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js new file mode 100644 index 00000000000..30138f958c8 --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js @@ -0,0 +1,143 @@ +/** + * Copyright 2023 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"; + +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) + + ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + Done + + + + + + Skip + + + +
+
+ +` + + template.substring(pos); + +// Extend the reception scenario with : +// - the new patched template +// - the js code for the new state +const ReceptionPackageDimension = process_registry.extend("reception", { + template: new_template, + "methods.get_packaging_measurements": function () { + return ["length", "width", "height", "weight", "qty", "barcode"]; + }, + "methods._get_states": function () { + let states = _get_states.bind(this)(); + states["set_packaging_dimension"] = { + display_info: { + title: "Set packaging dimension", + }, + events: { + go_back: "on_back", + }, + get_payload_set_packaging_dimension: () => { + let values = { + picking_id: this.state.data.picking.id, + selected_line_id: this.state.data.selected_move_line.id, + packaging_id: this.state.data.packaging.id, + }; + for (const measurement of this.get_packaging_measurements()) { + values[measurement] = this.state.data.packaging[measurement]; + } + return values; + }, + on_skip: () => { + const payload = this.state.get_payload_set_packaging_dimension(); + payload["cancel"] = true; + this.wait_call(this.odoo.call("set_packaging_dimension", payload)); + }, + on_done: () => { + const payload = this.state.get_payload_set_packaging_dimension(); + this.wait_call(this.odoo.call("set_packaging_dimension", payload)); + }, + }; + return states; + }, +}); + +process_registry.replace("reception", ReceptionPackageDimension); diff --git a/shopfloor_reception_packaging_dimension_mobile/templates/assets.xml b/shopfloor_reception_packaging_dimension_mobile/templates/assets.xml new file mode 100644 index 00000000000..000d0fa522b --- /dev/null +++ b/shopfloor_reception_packaging_dimension_mobile/templates/assets.xml @@ -0,0 +1,25 @@ + + + + + + +