From b828bbd544e3e0edb6dafe3e8841aa77010304b7 Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Tue, 7 Nov 2023 09:36:24 +0100 Subject: [PATCH 1/6] shopfloor: checkout fix line done with zero qty Follwing this change https://github.com/OCA/wms/commit/b2ce1bd25f6ab05bedff577ca26ccf8ddab98a30 Multiple lines are displayed in the `select_package` state. Some could have the quantity done set to zero. In that case the lines should not be set has checkout done. When putting lines in a package it is already handled by `_filter_lines_to_pack` --- shopfloor/services/checkout.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shopfloor/services/checkout.py b/shopfloor/services/checkout.py index b69ad5668d..01b8b6c81b 100644 --- a/shopfloor/services/checkout.py +++ b/shopfloor/services/checkout.py @@ -1137,7 +1137,10 @@ def no_package(self, picking_id, selected_line_ids): if message: return self._response_for_select_document(message=message) selected_lines = self.env["stock.move.line"].browse(selected_line_ids).exists() - selected_lines.write( + selected_lines_with_qty_done = selected_lines.filtered( + lambda line: line.qty_done > 0 + ) + selected_lines_with_qty_done.write( {"shopfloor_checkout_done": True, "result_package_id": False} ) response = self._check_allowed_qty_done(picking, selected_lines) From d217d4032774fb84e5a1002bbcb62e841eaf17db Mon Sep 17 00:00:00 2001 From: mymage Date: Sun, 12 Nov 2023 15:33:39 +0000 Subject: [PATCH 2/6] Translated using Weblate (Italian) Currently translated at 100.0% (305 of 305 strings) Translation: wms-14.0/wms-14.0-shopfloor Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/it/ --- shopfloor/i18n/it.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shopfloor/i18n/it.po b/shopfloor/i18n/it.po index 837ff825d4..68afd5d9ff 100644 --- a/shopfloor/i18n/it.po +++ b/shopfloor/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-10-29 08:27+0000\n" +"PO-Revision-Date: 2023-11-12 17:37+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -1020,7 +1020,7 @@ msgstr "Imballo non trovato nel trasferimento attuale." #: code:addons/shopfloor/actions/message.py:0 #, python-format msgid "Packaging {} dimension updated." -msgstr "" +msgstr "Dimensione imballo {} aggiornata." #. module: shopfloor #: code:addons/shopfloor/actions/message.py:0 From bb48d331bb9dfa514f428ce968edff11edfee1aa Mon Sep 17 00:00:00 2001 From: mymage Date: Sun, 12 Nov 2023 15:39:56 +0000 Subject: [PATCH 3/6] Translated using Weblate (Italian) Currently translated at 100.0% (47 of 47 strings) Translation: wms-14.0/wms-14.0-stock_dynamic_routing Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-stock_dynamic_routing/it/ --- stock_dynamic_routing/i18n/it.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_dynamic_routing/i18n/it.po b/stock_dynamic_routing/i18n/it.po index 252c3225a6..d5dec000c6 100644 --- a/stock_dynamic_routing/i18n/it.po +++ b/stock_dynamic_routing/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-10-29 08:27+0000\n" +"PO-Revision-Date: 2023-11-12 17:37+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -122,12 +122,12 @@ msgstr "Instradamento dinamico" #. module: stock_dynamic_routing #: model:stock.picking.type,name:stock_dynamic_routing.stock_picking_type_handover_to_highbay_demo msgid "Handover → Highbay" -msgstr "" +msgstr "Trasferimento → Scaffale" #. module: stock_dynamic_routing #: model:stock.picking.type,name:stock_dynamic_routing.stock_picking_type_highbay_to_handover_demo msgid "Highbay → Handover" -msgstr "" +msgstr "Scaffale → Trasferimento" #. module: stock_dynamic_routing #: model:ir.model.fields,field_description:stock_dynamic_routing.field_stock_location__id From 8d2196fa88c5e064ab18582352de0bb46e4e2710 Mon Sep 17 00:00:00 2001 From: mymage Date: Sun, 12 Nov 2023 15:31:02 +0000 Subject: [PATCH 4/6] Translated using Weblate (Italian) Currently translated at 100.0% (7 of 7 strings) Translation: wms-14.0/wms-14.0-shopfloor_reception_packaging_dimension Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor_reception_packaging_dimension/it/ --- .../i18n/it.po | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/shopfloor_reception_packaging_dimension/i18n/it.po b/shopfloor_reception_packaging_dimension/i18n/it.po index d4fbb6c1a3..2b37f8306b 100644 --- a/shopfloor_reception_packaging_dimension/i18n/it.po +++ b/shopfloor_reception_packaging_dimension/i18n/it.po @@ -6,23 +6,25 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-11-12 17:37+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 4.17\n" #. module: shopfloor_reception_packaging_dimension #: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__display_name msgid "Display Name" -msgstr "" +msgstr "Nome visualizzato" #. module: shopfloor_reception_packaging_dimension #: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__id msgid "ID" -msgstr "" +msgstr "ID" #. module: shopfloor_reception_packaging_dimension #: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension @@ -30,23 +32,25 @@ 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.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu____last_update msgid "Last Modified on" -msgstr "" +msgstr "Ultima modifica il" #. module: shopfloor_reception_packaging_dimension #: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu msgid "Menu displayed in the scanner application" -msgstr "" +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 "" +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 "" +msgstr "Imposta dimensione imballo" From c114af4e8165dadfc01aafd6ecf09a6682cd7ed6 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 13 Nov 2023 09:05:00 +0000 Subject: [PATCH 5/6] [BOT] post-merge updates --- README.md | 2 +- shopfloor/README.rst | 2 +- shopfloor/__manifest__.py | 2 +- shopfloor/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 168b7426bc..2e5275bafc 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ addon | version | maintainers | summary [sale_stock_available_to_promise_release](sale_stock_available_to_promise_release/) | 14.0.1.1.1 | | Integration between Sales and Available to Promise Release [sale_stock_available_to_promise_release_cutoff](sale_stock_available_to_promise_release_cutoff/) | 14.0.1.1.1 | | Cutoff management with respect to stock availability [sale_stock_available_to_promise_release_dropshipping](sale_stock_available_to_promise_release_dropshipping/) | 14.0.1.0.0 | | Glue module between sale_stock_available_to_promise_release and stock_dropshipping -[shopfloor](shopfloor/) | 14.0.4.3.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | manage warehouse operations with barcode scanners +[shopfloor](shopfloor/) | 14.0.4.3.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | manage warehouse operations with barcode scanners [shopfloor_base](shopfloor_base/) | 14.0.2.10.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | Core module for creating mobile apps [shopfloor_base_multicompany](shopfloor_base_multicompany/) | 14.0.1.0.0 | | Provide multi-company support and validation to Shopfloor applications. [shopfloor_batch_automatic_creation](shopfloor_batch_automatic_creation/) | 14.0.1.2.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Create batch transfers for Cluster Picking diff --git a/shopfloor/README.rst b/shopfloor/README.rst index 8debe0d94d..fc45976e59 100644 --- a/shopfloor/README.rst +++ b/shopfloor/README.rst @@ -7,7 +7,7 @@ Shopfloor !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:2910a8caf5e806e221d07da7125a7d9777cc8be0617d421ecb30da9776e190c0 + !! source digest: sha256:f1d165021abc730bc8bf96092b9f76139e4b17c777975af4c9e496f86774bab6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/shopfloor/__manifest__.py b/shopfloor/__manifest__.py index 6bcb03b29b..24f053bf1b 100644 --- a/shopfloor/__manifest__.py +++ b/shopfloor/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Shopfloor", "summary": "manage warehouse operations with barcode scanners", - "version": "14.0.4.3.0", + "version": "14.0.4.3.1", "development_status": "Beta", "category": "Inventory", "website": "https://github.com/OCA/wms", diff --git a/shopfloor/static/description/index.html b/shopfloor/static/description/index.html index dd350e5966..a6c2c6c887 100644 --- a/shopfloor/static/description/index.html +++ b/shopfloor/static/description/index.html @@ -367,7 +367,7 @@

Shopfloor

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:2910a8caf5e806e221d07da7125a7d9777cc8be0617d421ecb30da9776e190c0 +!! source digest: sha256:f1d165021abc730bc8bf96092b9f76139e4b17c777975af4c9e496f86774bab6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

Shopfloor is a barcode scanner application for internal warehouse operations.

From e08ad600b4676d80cba0766d5b7f22966f82314c Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Fri, 3 Nov 2023 08:46:40 +0100 Subject: [PATCH 6/6] shopfloor: add checkout option ask leaf location dest Following this change on the checkout scenario https://github.com/OCA/wms/pull/618 A check has been added to force the user to scan a child location if the destination location is not a leaf in the locations tree. To allow for flexibility this change adds the options to disable this feature. --- shopfloor/README.rst | 2 +- shopfloor/__manifest__.py | 2 +- shopfloor/data/shopfloor_scenario_data.xml | 3 +- .../migrations/14.0.4.4.0/post-migration.py | 41 +++++++++++++++++++ shopfloor/models/shopfloor_menu.py | 20 +++++++++ shopfloor/services/checkout.py | 13 +++--- shopfloor/static/description/index.html | 2 +- shopfloor/tests/test_checkout_done.py | 17 ++++++++ shopfloor/views/shopfloor_menu.xml | 10 +++++ 9 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 shopfloor/migrations/14.0.4.4.0/post-migration.py diff --git a/shopfloor/README.rst b/shopfloor/README.rst index fc45976e59..baa0cc03fc 100644 --- a/shopfloor/README.rst +++ b/shopfloor/README.rst @@ -7,7 +7,7 @@ Shopfloor !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:f1d165021abc730bc8bf96092b9f76139e4b17c777975af4c9e496f86774bab6 + !! source digest: sha256:b2c51fbfe37b326cc86b4856116825c4ccc2692b607ab630ac8e5a1e0baf5173 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/shopfloor/__manifest__.py b/shopfloor/__manifest__.py index 24f053bf1b..69d181623a 100644 --- a/shopfloor/__manifest__.py +++ b/shopfloor/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Shopfloor", "summary": "manage warehouse operations with barcode scanners", - "version": "14.0.4.3.1", + "version": "14.0.4.4.0", "development_status": "Beta", "category": "Inventory", "website": "https://github.com/OCA/wms", diff --git a/shopfloor/data/shopfloor_scenario_data.xml b/shopfloor/data/shopfloor_scenario_data.xml index 41768a3db3..4ceec12248 100644 --- a/shopfloor/data/shopfloor_scenario_data.xml +++ b/shopfloor/data/shopfloor_scenario_data.xml @@ -45,7 +45,8 @@ "no_prefill_qty": true, "show_oneline_package_content": true, "auto_post_line": true, - "scan_location_or_pack_first": true + "scan_location_or_pack_first": true, + "ask_for_leaf_destination_location" : true } diff --git a/shopfloor/migrations/14.0.4.4.0/post-migration.py b/shopfloor/migrations/14.0.4.4.0/post-migration.py new file mode 100644 index 0000000000..3d8a75e15f --- /dev/null +++ b/shopfloor/migrations/14.0.4.4.0/post-migration.py @@ -0,0 +1,41 @@ +# 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 + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + if not version: + return + env = api.Environment(cr, SUPERUSER_ID, {}) + checkout_scenario = env["shopfloor.scenario"].search([("key", "=", "checkout")]) + _update_scenario_options(checkout_scenario) + checkout_menus = env["shopfloor.menu"].search( + [("scenario_id", "=", checkout_scenario.id)] + ) + _enable_option_in_menus(checkout_menus) + + +def _update_scenario_options(scenario): + options = scenario.options + options["ask_for_leaf_destination_location"] = True + options_edit = json.dumps(options or {}, indent=4, sort_keys=True) + scenario.write({"options_edit": options_edit}) + _logger.info( + "Option ask_for_leaf_destination_location added to the Checkout scenario" + ) + + +def _enable_option_in_menus(menus): + for menu in menus: + menu.ask_for_leaf_destination_location = True + _logger.info( + "Option ask_for_leaf_destination_location enabled for menu {}".format( + menu.name + ) + ) diff --git a/shopfloor/models/shopfloor_menu.py b/shopfloor/models/shopfloor_menu.py index 7521a67db4..580090ec6f 100644 --- a/shopfloor/models/shopfloor_menu.py +++ b/shopfloor/models/shopfloor_menu.py @@ -53,6 +53,11 @@ to scan a destination package. """ +ASK_FOR_LEAF_DESTINATION_LOCATION_HELP = """ +When enabled, the destination location must be a leaf (location with no children) +location, if it is not, ask for scanning a child location of the destination. +""" + class ShopfloorMenu(models.Model): _inherit = "shopfloor.menu" @@ -226,6 +231,14 @@ class ShopfloorMenu(models.Model): allow_alternative_destination_package_is_possible = fields.Boolean( compute="_compute_allow_alternative_destination_package_is_possible" ) + ask_for_leaf_destination_location = fields.Boolean( + string="Ask for leaf destination location", + default=False, + help=ASK_FOR_LEAF_DESTINATION_LOCATION_HELP, + ) + ask_for_leaf_destination_location_is_possible = fields.Boolean( + compute="_compute_ask_for_leaf_destination_location_is_possible" + ) @api.onchange("unload_package_at_destination") def _onchange_unload_package_at_destination(self): @@ -455,3 +468,10 @@ def _compute_allow_alternative_destination_package_is_possible(self): menu.allow_alternative_destination_package_is_possible = ( menu.scenario_id.has_option("allow_alternative_destination_package") ) + + @api.depends("scenario_id") + def _compute_ask_for_leaf_destination_location_is_possible(self): + for menu in self: + menu.ask_for_leaf_destination_location_is_possible = ( + menu.scenario_id.has_option("ask_for_leaf_destination_location") + ) diff --git a/shopfloor/services/checkout.py b/shopfloor/services/checkout.py index 01b8b6c81b..9494bb1c76 100644 --- a/shopfloor/services/checkout.py +++ b/shopfloor/services/checkout.py @@ -1405,13 +1405,14 @@ def done(self, picking_id, confirmation=False): ) lines_done = self._lines_checkout_done(picking) dest_location = picking.location_dest_id - child_locations = self.env["stock.location"].search( - [("id", "child_of", dest_location.id), ("usage", "!=", "view")] - ) - if len(child_locations) > 0 and child_locations != dest_location: - return self._response_for_select_child_location( - picking, + if self.work.menu.ask_for_leaf_destination_location: + child_locations = self.env["stock.location"].search( + [("id", "child_of", dest_location.id), ("usage", "!=", "view")] ) + if len(child_locations) > 0 and child_locations != dest_location: + return self._response_for_select_child_location( + picking, + ) stock = self._actions_for("stock") stock.validate_moves(lines_done.move_id) return self._response_for_select_document( diff --git a/shopfloor/static/description/index.html b/shopfloor/static/description/index.html index a6c2c6c887..b34913d754 100644 --- a/shopfloor/static/description/index.html +++ b/shopfloor/static/description/index.html @@ -367,7 +367,7 @@

Shopfloor

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:f1d165021abc730bc8bf96092b9f76139e4b17c777975af4c9e496f86774bab6 +!! source digest: sha256:b2c51fbfe37b326cc86b4856116825c4ccc2692b607ab630ac8e5a1e0baf5173 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

Shopfloor is a barcode scanner application for internal warehouse operations.

diff --git a/shopfloor/tests/test_checkout_done.py b/shopfloor/tests/test_checkout_done.py index a9acce2032..ccd2b173c2 100644 --- a/shopfloor/tests/test_checkout_done.py +++ b/shopfloor/tests/test_checkout_done.py @@ -60,11 +60,28 @@ def test_done_partial(self): ) def test_done_partial_confirm(self): + """Check confirm partially done no check for leaf location.""" # lines are done response = self.service.dispatch( "done", params={"picking_id": self.picking.id, "confirmation": True} ) + self.assertRecordValues(self.picking, [{"state": "done"}]) + + self.assert_response( + response, + next_state="select_document", + message=self.service.msg_store.transfer_done_success(self.picking), + data={"restrict_scan_first": False}, + ) + + def test_done_partial_confirm_ask_leaf_location(self): + """Check confirm partially done with force leaf location option on.""" + self.menu.sudo().ask_for_leaf_destination_location = True + response = self.service.dispatch( + "done", params={"picking_id": self.picking.id, "confirmation": True} + ) + self.assertRecordValues(self.picking, [{"state": "assigned"}]) self.assert_response( diff --git a/shopfloor/views/shopfloor_menu.xml b/shopfloor/views/shopfloor_menu.xml index 868dc85c6c..12143b931c 100644 --- a/shopfloor/views/shopfloor_menu.xml +++ b/shopfloor/views/shopfloor_menu.xml @@ -168,6 +168,16 @@ /> + + + +