From 5eec14f33abfc1de01d17fcffab4bee44ee5484c Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Fri, 26 Jan 2024 11:03:07 +0100 Subject: [PATCH] shopfloor_delivery_shipment_mobile: add pack sales grouping --- .../wms/src/scenario/delivery_shipment.js | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/shopfloor_delivery_shipment_mobile/static/wms/src/scenario/delivery_shipment.js b/shopfloor_delivery_shipment_mobile/static/wms/src/scenario/delivery_shipment.js index a7e4779bd8..23214d5e8a 100644 --- a/shopfloor_delivery_shipment_mobile/static/wms/src/scenario/delivery_shipment.js +++ b/shopfloor_delivery_shipment_mobile/static/wms/src/scenario/delivery_shipment.js @@ -71,13 +71,20 @@ const DeliveryShipment = { {{ name }} {{ package_level_process(value.package_levels) }} - + +
+ + {{ name }} + + +
+ { + // Package data can be grouped by sales order, put them all in one array + const all_package_levels = Object.values(package_levels).flat(); + const package_level_count = all_package_levels.length; + const done_package_level_count = all_package_levels.reduce((acc, next) => { return next.is_done ? acc + 1 : acc; }, 0); return `Progress: ${done_package_level_count} / ${package_level_count}`;