diff --git a/README.md b/README.md
index c0217542dd..c505822d9a 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ addon | version | maintainers | summary
[sale_stock_release_channel_delivery_date](sale_stock_release_channel_delivery_date/) | 16.0.1.1.2 |
| Compute expected date based on available release channels
[sale_stock_release_channel_partner_by_date](sale_stock_release_channel_partner_by_date/) | 16.0.1.1.0 |
| Release channels integration with Sales
[sale_stock_release_channel_partner_by_date_delivery](sale_stock_release_channel_partner_by_date_delivery/) | 16.0.1.1.1 |
| Filters channels on sales based on selected carrier.
-[shopfloor](shopfloor/) | 16.0.2.16.1 |
| manage warehouse operations with barcode scanners
+[shopfloor](shopfloor/) | 16.0.2.16.2 |
| manage warehouse operations with barcode scanners
[shopfloor_base](shopfloor_base/) | 16.0.1.2.1 |
| Core module for creating mobile apps
[shopfloor_batch_automatic_creation](shopfloor_batch_automatic_creation/) | 16.0.1.1.0 |
| Create batch transfers for Cluster Picking
[shopfloor_mobile](shopfloor_mobile/) | 16.0.1.4.1 |
| Mobile frontend for WMS Shopfloor app
diff --git a/shopfloor/README.rst b/shopfloor/README.rst
index 16df3b9d27..21d9f05f19 100644
--- a/shopfloor/README.rst
+++ b/shopfloor/README.rst
@@ -11,7 +11,7 @@ Shopfloor
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:9f90d6a5968a33846a7f00f6daac7c54a3097b54e13d308bdc964d8115207c58
+ !! source digest: sha256:cdba7e2cc373fe847373edb11404381cbae37c91bf1cc810d257ba2602aa4ae7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/shopfloor/__manifest__.py b/shopfloor/__manifest__.py
index 1aefbb909c..2c56784d5f 100644
--- a/shopfloor/__manifest__.py
+++ b/shopfloor/__manifest__.py
@@ -6,7 +6,7 @@
{
"name": "Shopfloor",
"summary": "manage warehouse operations with barcode scanners",
- "version": "16.0.2.16.1",
+ "version": "16.0.2.16.2",
"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 86a779984f..1986edf98c 100644
--- a/shopfloor/static/description/index.html
+++ b/shopfloor/static/description/index.html
@@ -372,7 +372,7 @@
Shopfloor is a barcode scanner application for internal warehouse operations.
diff --git a/shopfloor/tests/test_actions_data.py b/shopfloor/tests/test_actions_data.py index 22717b1d36..cc1d57201c 100644 --- a/shopfloor/tests/test_actions_data.py +++ b/shopfloor/tests/test_actions_data.py @@ -1,6 +1,7 @@ # Copyright 2020 Camptocamp SA (http://www.camptocamp.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # pylint: disable=missing-return + from markupsafe import Markup from .common import PickingBatchMixin @@ -43,21 +44,50 @@ def test_data_location_no_barcode(self): } self.assertDictEqual(data, expected) + def test_data_location_with_operation_progress_schema(self): + data = self.data.location(self.stock_location, with_operation_progress=True) + self.assert_schema(self.schema.location(), data) + def test_data_location_with_operation_progress(self): - location = self.stock_location - location.sudo().barcode = None + location_model = self.env["stock.location"].sudo() + location = location_model.create( + { + "name": "test_location", + "location_id": self.stock_location.id, + } + ) + product = self.product_a + picking = self._create_picking(lines=[(product, 1000)]) + picking.location_id = location + picking.location_dest_id = location.location_id + move = picking.move_ids + # Move isn't confirmed, no data in operation progress data = self.data.location(location, with_operation_progress=True) - self.assert_schema(self.schema.location(), data) expected = { "id": location.id, "name": location.name, "barcode": location.name, "operation_progress": { "done": 0.0, - "to_do": 228.0, + "to_do": 0.0, }, } self.assertDictEqual(data, expected) + # Move is assigned, but no qty in stock: no qty to process + move._action_confirm() + data = self.data.location(location, with_operation_progress=True) + self.assertDictEqual(data, expected) + # Add goods in stock, available qty goes in to_do + self._update_qty_in_location(location, product, 500) + move._action_assign() + data = self.data.location(location, with_operation_progress=True) + expected["operation_progress"] = {"done": 0.0, "to_do": 500.0} + self.assertDictEqual(data, expected) + # pick a few units, picked qties are done, to_do is the rest + move.move_line_ids.qty_done = 250 + data = self.data.location(location, with_operation_progress=True) + expected["operation_progress"] = {"done": 250.0, "to_do": 250.0} + self.assertDictEqual(data, expected) def test_data_lot(self): lot = self.env["stock.lot"].create(