From c4accdf75ec7296ff4faf805d1e5d7ad645728f6 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Wed, 28 Jan 2026 14:48:04 +0100 Subject: [PATCH 1/4] [IMP] shopfloor_reception_mobile: display qty_done over total qty in select_move. This commit changes the rendering of the "Qty done" field on the move card in "select_move" state like so: "Qty done: 7" -> "Qty done: 7/10" --- shopfloor_reception_mobile/static/src/scenario/reception.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shopfloor_reception_mobile/static/src/scenario/reception.js b/shopfloor_reception_mobile/static/src/scenario/reception.js index 761e0aa6587..2bfdea82f9c 100644 --- a/shopfloor_reception_mobile/static/src/scenario/reception.js +++ b/shopfloor_reception_mobile/static/src/scenario/reception.js @@ -407,6 +407,9 @@ const Reception = { path: "quantity_done", label: "Qty done", display_no_value: true, + renderer: function (rec, field) { + return rec.quantity_done + " / " + rec.quantity; + }, }, ], }, From 9c06549937f00e77ed172de1be4ca8d413cf5fb7 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Thu, 7 May 2026 12:16:56 +0200 Subject: [PATCH 2/4] [IMP] shopfloor_mobile: add qtyTodo on "PackagingQtyPickerDisplay" This commit also simplifies the code a bit by moving the string construction from the Vue template to JS method. --- .../src/components/packaging-qty-picker.js | 65 +++++++++++++++---- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/shopfloor_mobile/static/wms/src/components/packaging-qty-picker.js b/shopfloor_mobile/static/wms/src/components/packaging-qty-picker.js index 6976c8918d9..0ebbaafea9d 100644 --- a/shopfloor_mobile/static/wms/src/components/packaging-qty-picker.js +++ b/shopfloor_mobile/static/wms/src/components/packaging-qty-picker.js @@ -297,15 +297,16 @@ export var PackagingQtyPickerDisplay = Vue.component("packaging-qty-picker-displ props: { nonZeroOnly: Boolean, pkgNameKey: {default: "code"}, + qtyTodo: Number, }, methods: { - display_pkg: function (pkg) { - return this.nonZeroOnly ? this.qty_by_pkg[pkg.id] > 0 : true; + display_pkg: function (pkg, qty_by_pkg) { + return this.nonZeroOnly ? qty_by_pkg[pkg.id] > 0 : true; }, - }, - computed: { - visible_packaging: function () { - let packagings = _.filter(this.sorted_packaging, this.display_pkg); + get_visible_packaging: function (qty_by_pkg) { + let packagings = _.filter(this.sorted_packaging, (pkg) => { + return this.display_pkg(pkg, qty_by_pkg); + }); // Do not display if only uom packaging if ( packagings.length == 1 && @@ -314,16 +315,54 @@ export var PackagingQtyPickerDisplay = Vue.component("packaging-qty-picker-displ return []; return packagings; }, + /** + * Returns the quantity by packaging string for a given quantity + * Example: "(1 PAL + 3 TU)" + */ + _product_qty_by_packaging_string: function (qty) { + const qty_by_pkg = this._product_qty_by_packaging( + this.sorted_packaging, + qty + ); + + const visible_pkgs = this.get_visible_packaging(qty_by_pkg); + + // Do not display if only uom packaging + if ( + visible_pkgs.length === 1 && + visible_pkgs[0].id.toString().startsWith("uom-") + ) { + return ""; + } + + const parts = visible_pkgs.map((pkg) => { + const count = qty_by_pkg[pkg.id]; + const name = pkg[this.pkgNameKey] || this.unit_uom.name; + return `${count} ${name}`; + }); + + return parts.length ? "(" + parts.join(" + ") + ")" : ""; + }, + }, + computed: { + qtyInitDisplay: function () { + const qty_by_pkg_str = this._product_qty_by_packaging_string(this.qtyInit); + return `${this.qty} ${this.unit_uom.name}${ + qty_by_pkg_str ? " " + qty_by_pkg_str : "" + }`; + }, + qtyTodoDisplay: function () { + const qty_by_pkg_str = this._product_qty_by_packaging_string(this.qtyTodo); + return `${this.qtyTodo} ${this.unit_uom.name}${ + qty_by_pkg_str ? " " + qty_by_pkg_str : "" + }`; + }, }, template: `
- {{ qty }} {{ unit_uom.name }} - - ( - - + - ) - + {{ qtyInitDisplay }} + / + {{ qtyTodoDisplay }}
`, }); From c7b3d33a065758567cb9f1462b081afc7f8178e3 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Thu, 7 May 2026 12:18:24 +0200 Subject: [PATCH 3/4] [IMP] shopfloor_reception_mobile: display qty by packaging --- .../static/src/scenario/reception.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/shopfloor_reception_mobile/static/src/scenario/reception.js b/shopfloor_reception_mobile/static/src/scenario/reception.js index 2bfdea82f9c..83cf59e0d00 100644 --- a/shopfloor_reception_mobile/static/src/scenario/reception.js +++ b/shopfloor_reception_mobile/static/src/scenario/reception.js @@ -380,6 +380,7 @@ const Reception = { }; }, picking_detail_options_for_select_move: function () { + const self = this; return { show_title: true, showActions: false, @@ -407,8 +408,15 @@ const Reception = { path: "quantity_done", label: "Qty done", display_no_value: true, - renderer: function (rec, field) { - return rec.quantity_done + " / " + rec.quantity; + render_component: "packaging-qty-picker-display", + render_props: (record) => { + return self.utils.wms.move_line_qty_picker_props( + record, + { + qtyInit: record.quantity_done, + qtyDone: record.quantity, + } + ); }, }, ], From 40a5afa14a9831259926378dd4aa4b74fd2a21b1 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Thu, 7 May 2026 12:44:31 +0200 Subject: [PATCH 4/4] [FIX] shopfloor: control qtyTodo visibility in packaging-qty-picker-display --- shopfloor_mobile/static/wms/src/wms_utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shopfloor_mobile/static/wms/src/wms_utils.js b/shopfloor_mobile/static/wms/src/wms_utils.js index a086133c321..8c0cc2c3f89 100644 --- a/shopfloor_mobile/static/wms/src/wms_utils.js +++ b/shopfloor_mobile/static/wms/src/wms_utils.js @@ -296,6 +296,8 @@ export class WMSUtils { render_props: function (record) { return self.move_line_qty_picker_props(record, { qtyInit: record.quantity, + // ↓ we do not want to display "/ qtyTodo" in normal case + qtyTodo: undefined, }); }, },