odoo-addon-shopfloor-mobile 16.0.1.4.0__py3-none-any.whl → 18.0.1.0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-shopfloor-mobile might be problematic. Click here for more details.
- odoo/addons/shopfloor_mobile/README.rst +14 -10
- odoo/addons/shopfloor_mobile/__manifest__.py +2 -2
- odoo/addons/shopfloor_mobile/i18n/shopfloor_mobile.pot +1 -1
- odoo/addons/shopfloor_mobile/static/description/index.html +31 -25
- odoo/addons/shopfloor_mobile/static/wms/src/components/{batch_picking_detail.js → batch_picking_detail.esm.js} +0 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_location.js → detail_location.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_lot.js → detail_lot.esm.js} +2 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_operation.js → detail_operation.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_package.js → detail_package.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_product.js → detail_product.esm.js} +2 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_transfer.js → detail_transfer.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/forms/{form_edit_stock_picking.js → form_edit_stock_picking.esm.js} +0 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/{manual_select_color.js → manual_select_color.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/components/{misc.js → misc.esm.js} +1 -3
- odoo/addons/shopfloor_mobile/static/wms/src/components/{packaging-qty-picker.js → packaging-qty-picker.esm.js} +20 -18
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/{mixins.js → mixins.esm.js} +2 -3
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/{picking_select.js → picking_select.esm.js} +8 -5
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/{picking_summary.js → picking_summary.esm.js} +11 -5
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.checkout.js → demo.checkout.esm.js} +4 -4
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.cluster_picking.js → demo.cluster_picking.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.delivery.js → demo.delivery.esm.js} +3 -3
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.location_content_transfer.js → demo.location_content_transfer.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.scan_anything.js → demo.scan_anything.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.single_pack_transfer.js → demo.single_pack_transfer.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.zone_picking.js → demo.zone_picking.esm.js} +3 -3
- odoo/addons/shopfloor_mobile/static/wms/src/i18n/{add_translations_to_registry.js → add_translations_to_registry.esm.js} +1 -1
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{checkout.js → checkout.esm.js} +7 -6
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{checkout_states.js → checkout_states.esm.js} +3 -1
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{cluster_picking.js → cluster_picking.esm.js} +8 -7
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{delivery.js → delivery.esm.js} +10 -6
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{location_content_transfer.js → location_content_transfer.esm.js} +13 -7
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{single_pack_transfer.js → single_pack_transfer.esm.js} +2 -2
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/{zone_picking.js → zone_picking.esm.js} +21 -24
- odoo/addons/shopfloor_mobile/static/wms/src/{wms_utils.js → wms_utils.esm.js} +29 -26
- odoo/addons/shopfloor_mobile/templates/assets.xml +30 -30
- {odoo_addon_shopfloor_mobile-16.0.1.4.0.dist-info → odoo_addon_shopfloor_mobile-18.0.1.0.0.3.dist-info}/METADATA +23 -18
- odoo_addon_shopfloor_mobile-18.0.1.0.0.3.dist-info/RECORD +59 -0
- {odoo_addon_shopfloor_mobile-16.0.1.4.0.dist-info → odoo_addon_shopfloor_mobile-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
- odoo_addon_shopfloor_mobile-18.0.1.0.0.3.dist-info/top_level.txt +1 -0
- odoo_addon_shopfloor_mobile-16.0.1.4.0.dist-info/RECORD +0 -59
- odoo_addon_shopfloor_mobile-16.0.1.4.0.dist-info/top_level.txt +0 -1
- /odoo/addons/shopfloor_mobile/static/wms/src/components/{batch_picking_line_detail.js → batch_picking_line_detail.esm.js} +0 -0
- /odoo/addons/shopfloor_mobile/static/wms/src/components/detail/{detail_picking.js → detail_picking.esm.js} +0 -0
- /odoo/addons/shopfloor_mobile/static/wms/src/{screen.js → screen.esm.js} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
const select_pack_picking = demotools.makePicking(
|
|
10
10
|
{},
|
|
@@ -72,7 +72,7 @@ const DEMO_CHECKOUT = {
|
|
|
72
72
|
scan_package_action: function (data) {
|
|
73
73
|
const res = data_for_select_package;
|
|
74
74
|
const line = res.data.select_package.selected_move_lines.find(function (x) {
|
|
75
|
-
return x.product.barcode
|
|
75
|
+
return x.product.barcode === data.barcode;
|
|
76
76
|
});
|
|
77
77
|
line.qty_done++;
|
|
78
78
|
return res;
|
|
@@ -102,7 +102,7 @@ const DEMO_CHECKOUT = {
|
|
|
102
102
|
set_line_qty: function (data) {
|
|
103
103
|
const res = data_for_set_line_qty;
|
|
104
104
|
const line = res.data.select_package.selected_move_lines.filter(function (x) {
|
|
105
|
-
return x.id
|
|
105
|
+
return x.id === data.move_line_id;
|
|
106
106
|
})[0];
|
|
107
107
|
line.qty_done = line.quantity;
|
|
108
108
|
return res;
|
|
@@ -110,7 +110,7 @@ const DEMO_CHECKOUT = {
|
|
|
110
110
|
reset_line_qty: function (data) {
|
|
111
111
|
const res = data_for_set_line_qty;
|
|
112
112
|
const line = res.data.select_package.selected_move_lines.filter(function (x) {
|
|
113
|
-
return x.id
|
|
113
|
+
return x.id === data.move_line_id;
|
|
114
114
|
})[0];
|
|
115
115
|
line.qty_done = 0;
|
|
116
116
|
return res;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
const DEMO_CLUSTER_PICKING_1 = {
|
|
10
10
|
find_batch: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
const pickings = [];
|
|
10
10
|
const count = 8;
|
|
@@ -14,9 +14,9 @@ for (let i = 1; i < count + 1; i++) {
|
|
|
14
14
|
{},
|
|
15
15
|
{lines_count: demotools.getRandomInt(5), line_random_pack: true}
|
|
16
16
|
);
|
|
17
|
-
for (let
|
|
17
|
+
for (let j = 0; j < demotools.getRandomInt(move_lines.length); j++) {
|
|
18
18
|
// Set some as done
|
|
19
|
-
move_lines[
|
|
19
|
+
move_lines[j].qty_done = move_lines[j].quantity;
|
|
20
20
|
}
|
|
21
21
|
pickings.push(
|
|
22
22
|
demotools.makePicking(
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
// Case for recover existing work on single move line
|
|
10
10
|
const recover_single_move_line_menu_id = demotools.addAppMenu({
|
odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.scan_anything.js → demo.scan_anything.esm.js}
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
8
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
9
9
|
|
|
10
10
|
const DEMO_SCAN_ANYTHING_PACK1 = {
|
|
11
11
|
data: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
// TODO: refactor w/ demotools data
|
|
10
10
|
const CANCEL_MSG_DEFAULT = {
|
odoo/addons/shopfloor_mobile/static/wms/src/demo/{demo.zone_picking.js → demo.zone_picking.esm.js}
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {demotools} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {demotools} from "/shopfloor_mobile_base/static/src/demo/demo.core.esm.js";
|
|
8
8
|
|
|
9
9
|
function _makePickingType() {
|
|
10
10
|
const lines_count = demotools.getRandomInt(10);
|
|
@@ -64,7 +64,7 @@ const move_lines = demotools.makePickingLines(
|
|
|
64
64
|
const select_line_move_lines = _.orderBy(move_lines, ["priority"], ["desc"]);
|
|
65
65
|
_.forEach(select_line_move_lines, function (line, i) {
|
|
66
66
|
// Simulate random flag
|
|
67
|
-
line.location_will_be_empty = i % 3
|
|
67
|
+
line.location_will_be_empty = i % 3 === 0;
|
|
68
68
|
// Simulate adding 1 qty
|
|
69
69
|
line.qty_done++;
|
|
70
70
|
});
|
|
@@ -111,7 +111,7 @@ const DEMO_CASE_1 = {
|
|
|
111
111
|
},
|
|
112
112
|
list_move_lines: function (data) {
|
|
113
113
|
const res = _.cloneDeep(list_move_lines);
|
|
114
|
-
if (data.order
|
|
114
|
+
if (data.order === "location") {
|
|
115
115
|
res.data.select_line.move_lines = _.orderBy(
|
|
116
116
|
res.data.select_line.move_lines,
|
|
117
117
|
["location_src.name"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {translation_registry} from "/shopfloor_mobile_base/static/
|
|
1
|
+
import {translation_registry} from "/shopfloor_mobile_base/static/src/services/translation_registry.esm.js";
|
|
2
2
|
|
|
3
3
|
translation_registry.load("fr-FR", "/shopfloor_mobile/static/wms/src/i18n/fr.json");
|
|
4
4
|
translation_registry.load("en-US", "/shopfloor_mobile/static/wms/src/i18n/en.json");
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
/* eslint-disable sort-imports */
|
|
8
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
9
|
+
import event_hub from "/shopfloor_mobile_base/static/src/services/event_hub.esm.js";
|
|
10
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
11
|
+
import {checkout_states} from "./checkout_states.esm.js";
|
|
11
12
|
|
|
12
13
|
const Checkout = {
|
|
13
14
|
mixins: [ScenarioBaseMixin],
|
|
@@ -297,7 +298,7 @@ const Checkout = {
|
|
|
297
298
|
path: "priority",
|
|
298
299
|
render_component: "priority-widget",
|
|
299
300
|
render_options: function (record) {
|
|
300
|
-
const priority = parseInt(record.priority);
|
|
301
|
+
const priority = parseInt(record.priority, 10) || 0;
|
|
301
302
|
// We need to pass the label to the component as an option instead of using "display_no_value"
|
|
302
303
|
// because pickings with no priority will still have a string value of "0"
|
|
303
304
|
// and the label would always be displayed.
|
|
@@ -351,7 +352,7 @@ const Checkout = {
|
|
|
351
352
|
select_line_detail_picking_select_props: function () {
|
|
352
353
|
const picking = this.state.data.picking;
|
|
353
354
|
const lines = picking.move_lines;
|
|
354
|
-
let grouped_lines =
|
|
355
|
+
let grouped_lines = [];
|
|
355
356
|
if (this.state.data.group_lines_by_location) {
|
|
356
357
|
grouped_lines = this.select_line_manual_select_group_lines(lines);
|
|
357
358
|
}
|
odoo/addons/shopfloor_mobile/static/wms/src/scenario/{checkout_states.js → checkout_states.esm.js}
RENAMED
|
@@ -24,6 +24,7 @@ export const checkout_states = function ($instance) {
|
|
|
24
24
|
$instance.odoo.call("scan_document", {barcode: scanned.text})
|
|
25
25
|
);
|
|
26
26
|
},
|
|
27
|
+
// eslint-disable-next-line no-unused-vars
|
|
27
28
|
on_manual_selection: (evt) => {
|
|
28
29
|
$instance.wait_call($instance.odoo.call("list_stock_picking"));
|
|
29
30
|
},
|
|
@@ -150,7 +151,8 @@ export const checkout_states = function ($instance) {
|
|
|
150
151
|
);
|
|
151
152
|
})
|
|
152
153
|
);
|
|
153
|
-
let endpoint,
|
|
154
|
+
let endpoint = "",
|
|
155
|
+
move_line = {};
|
|
154
156
|
if (to_unselect) {
|
|
155
157
|
endpoint = "reset_line_qty";
|
|
156
158
|
move_line = to_unselect;
|
odoo/addons/shopfloor_mobile/static/wms/src/scenario/{cluster_picking.js → cluster_picking.esm.js}
RENAMED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/
|
|
8
|
-
import {process_registry} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
8
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
9
9
|
|
|
10
10
|
// TODO: consider replacing the dynamic "autofocus" in the searchbar by an event.
|
|
11
11
|
// At the moment, we need autofocus to be disabled if there's a user popup.
|
|
@@ -189,10 +189,10 @@ const ClusterPicking = {
|
|
|
189
189
|
scan_destination_qty: 0,
|
|
190
190
|
states: {
|
|
191
191
|
start: {
|
|
192
|
-
on_get_work: (
|
|
192
|
+
on_get_work: () => {
|
|
193
193
|
this.wait_call(this.odoo.call("find_batch"));
|
|
194
194
|
},
|
|
195
|
-
on_manual_selection: (
|
|
195
|
+
on_manual_selection: () => {
|
|
196
196
|
this.wait_call(this.odoo.call("list_batch"));
|
|
197
197
|
},
|
|
198
198
|
},
|
|
@@ -375,8 +375,8 @@ const ClusterPicking = {
|
|
|
375
375
|
// FIXME: use state_load or traverse the state
|
|
376
376
|
// this.current_state_key = "unload_all";
|
|
377
377
|
// this.state.on_scan(scanned, confirmation);
|
|
378
|
-
|
|
379
|
-
this.states.unload_all.on_scan(scanned,
|
|
378
|
+
const confirm = this.state.data.confirmation || confirmation;
|
|
379
|
+
this.states.unload_all.on_scan(scanned, confirm);
|
|
380
380
|
},
|
|
381
381
|
},
|
|
382
382
|
unload_single: {
|
|
@@ -422,7 +422,8 @@ const ClusterPicking = {
|
|
|
422
422
|
this.wait_call(
|
|
423
423
|
this.odoo.call("unload_scan_destination", {
|
|
424
424
|
picking_batch_id: this.current_batch().id,
|
|
425
|
-
|
|
425
|
+
// FIXME: where does it come from? backend data?
|
|
426
|
+
package_id: null,
|
|
426
427
|
barcode: scanned.text,
|
|
427
428
|
confirmation: this.state.data.confirmation || "",
|
|
428
429
|
})
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/
|
|
8
|
-
import {process_registry} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
8
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
9
9
|
|
|
10
10
|
const Delivery = {
|
|
11
11
|
mixins: [ScenarioBaseMixin],
|
|
@@ -129,12 +129,13 @@ const Delivery = {
|
|
|
129
129
|
"package_src"
|
|
130
130
|
),
|
|
131
131
|
group_color_maker: function (lines) {
|
|
132
|
-
return self.utils.wms.move_lines_completeness(lines)
|
|
132
|
+
return self.utils.wms.move_lines_completeness(lines) === 100
|
|
133
133
|
? "screen_step_done"
|
|
134
134
|
: "screen_step_todo";
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
|
+
/* eslint-disable no-unused-vars */
|
|
138
139
|
deliver_move_line_list_options: function (picking) {
|
|
139
140
|
return {
|
|
140
141
|
list_item_options: {
|
|
@@ -174,9 +175,8 @@ const Delivery = {
|
|
|
174
175
|
const operation_progress = this._get_operation_progress_data();
|
|
175
176
|
if (operation_progress.done === operation_progress.to_do) {
|
|
176
177
|
return this.utils.colors.color_for("screen_step_done");
|
|
177
|
-
} else {
|
|
178
|
-
return this.utils.colors.color_for("screen_step_todo");
|
|
179
178
|
}
|
|
179
|
+
return this.utils.colors.color_for("screen_step_todo");
|
|
180
180
|
},
|
|
181
181
|
_get_operation_progress_data: function () {
|
|
182
182
|
return _.result(this.state, "data.sublocation.operation_progress", false);
|
|
@@ -202,6 +202,7 @@ const Delivery = {
|
|
|
202
202
|
{
|
|
203
203
|
path: "move_line_count",
|
|
204
204
|
label: "Lines",
|
|
205
|
+
|
|
205
206
|
renderer: function (rec, field) {
|
|
206
207
|
return (
|
|
207
208
|
self.utils.wms.completed_move_lines(rec.move_lines) +
|
|
@@ -236,6 +237,7 @@ const Delivery = {
|
|
|
236
237
|
this.odoo.call("scan_deliver", {barcode: scanned.text})
|
|
237
238
|
);
|
|
238
239
|
},
|
|
240
|
+
|
|
239
241
|
on_manual_selection: (evt) => {
|
|
240
242
|
this.wait_call(this.odoo.call("list_stock_picking"));
|
|
241
243
|
},
|
|
@@ -257,6 +259,7 @@ const Delivery = {
|
|
|
257
259
|
})
|
|
258
260
|
);
|
|
259
261
|
},
|
|
262
|
+
|
|
260
263
|
on_manual_selection: (evt) => {
|
|
261
264
|
this.wait_call(
|
|
262
265
|
this.odoo.call("list_stock_picking", {
|
|
@@ -265,7 +268,8 @@ const Delivery = {
|
|
|
265
268
|
);
|
|
266
269
|
},
|
|
267
270
|
on_cancel: (data) => {
|
|
268
|
-
let endpoint
|
|
271
|
+
let endpoint = "";
|
|
272
|
+
let endpoint_data = "";
|
|
269
273
|
// TODO: can't we have a single endpoint as per checkout.summary.destroy?
|
|
270
274
|
if (data.package_id) {
|
|
271
275
|
endpoint = "reset_qty_done_pack";
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/
|
|
8
|
-
import {process_registry} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
8
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
9
9
|
|
|
10
10
|
// TODO: consider replacing the dynamic "autofocus" in the searchbar by an event.
|
|
11
11
|
// At the moment, we need autofocus to be disabled if there's a user popup.
|
|
@@ -190,10 +190,11 @@ const LocationContentTransfer = {
|
|
|
190
190
|
},
|
|
191
191
|
// Common actions
|
|
192
192
|
on_line_action: function (action) {
|
|
193
|
-
this["on_" + action.event_name]
|
|
193
|
+
this["on_" + action.event_name](this);
|
|
194
194
|
},
|
|
195
195
|
on_action_postpone: function () {
|
|
196
|
-
let endpoint
|
|
196
|
+
let endpoint = "";
|
|
197
|
+
let endpoint_data = {};
|
|
197
198
|
const data = this.state.data;
|
|
198
199
|
if (data.package_level) {
|
|
199
200
|
endpoint = "postpone_package";
|
|
@@ -235,9 +236,11 @@ const LocationContentTransfer = {
|
|
|
235
236
|
},
|
|
236
237
|
},
|
|
237
238
|
get_work: {
|
|
239
|
+
/* eslint-disable no-unused-vars */
|
|
238
240
|
on_get_work: (evt) => {
|
|
239
241
|
this.wait_call(this.odoo.call("find_work"));
|
|
240
242
|
},
|
|
243
|
+
/* eslint-disable no-unused-vars */
|
|
241
244
|
on_manual_selection: (evt) => {
|
|
242
245
|
this.state_to("scan_location");
|
|
243
246
|
},
|
|
@@ -292,7 +295,8 @@ const LocationContentTransfer = {
|
|
|
292
295
|
),
|
|
293
296
|
},
|
|
294
297
|
on_scan: (scanned) => {
|
|
295
|
-
let endpoint
|
|
298
|
+
let endpoint = "";
|
|
299
|
+
let endpoint_data = {};
|
|
296
300
|
const data = this.state.data;
|
|
297
301
|
if (data.package_level) {
|
|
298
302
|
endpoint = "scan_package";
|
|
@@ -329,7 +333,8 @@ const LocationContentTransfer = {
|
|
|
329
333
|
this.scan_destination_qty = parseInt(qty, 10);
|
|
330
334
|
},
|
|
331
335
|
on_scan: (scanned) => {
|
|
332
|
-
let endpoint
|
|
336
|
+
let endpoint = "";
|
|
337
|
+
let endpoint_data = {};
|
|
333
338
|
const data = this.state.data;
|
|
334
339
|
if (data.package_level) {
|
|
335
340
|
endpoint = "set_destination_package";
|
|
@@ -363,7 +368,8 @@ const LocationContentTransfer = {
|
|
|
363
368
|
this.reset_notification();
|
|
364
369
|
},
|
|
365
370
|
on_confirm_stock_issue: () => {
|
|
366
|
-
let endpoint
|
|
371
|
+
let endpoint = "";
|
|
372
|
+
let endpoint_data = {};
|
|
367
373
|
const data = this.state.data;
|
|
368
374
|
if (data.package_level) {
|
|
369
375
|
endpoint = "stock_out_package";
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/
|
|
10
|
-
import {process_registry} from "/shopfloor_mobile_base/static/
|
|
9
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
10
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
11
11
|
|
|
12
12
|
export var SinglePackStatesMixin = {
|
|
13
13
|
data: function () {
|
odoo/addons/shopfloor_mobile/static/wms/src/scenario/{zone_picking.js → zone_picking.esm.js}
RENAMED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/
|
|
8
|
-
import {process_registry} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/src/scenario/mixins.esm.js";
|
|
8
|
+
import {process_registry} from "/shopfloor_mobile_base/static/src/services/process_registry.esm.js";
|
|
9
9
|
|
|
10
10
|
// TODO: consider replacing the dynamic "autofocus" in the searchbar by an event.
|
|
11
11
|
// At the moment, we need autofocus to be disabled if there's a user popup.
|
|
@@ -378,6 +378,7 @@ const ZonePicking = {
|
|
|
378
378
|
},
|
|
379
379
|
];
|
|
380
380
|
},
|
|
381
|
+
/* eslint-disable no-unused-vars */
|
|
381
382
|
picking_type_render_lines_count(record, field) {
|
|
382
383
|
return _.template("(${counters}) ${name}")({
|
|
383
384
|
counters: this.$t("misc.lines_count", record),
|
|
@@ -525,9 +526,8 @@ const ZonePicking = {
|
|
|
525
526
|
renderer: function (rec, field) {
|
|
526
527
|
if (rec.handle_complete_mix_pack) {
|
|
527
528
|
return "";
|
|
528
|
-
} else {
|
|
529
|
-
return rec.product.display_name;
|
|
530
529
|
}
|
|
530
|
+
return rec.product.display_name;
|
|
531
531
|
},
|
|
532
532
|
},
|
|
533
533
|
{
|
|
@@ -583,7 +583,7 @@ const ZonePicking = {
|
|
|
583
583
|
},
|
|
584
584
|
toggle_sort_lines_by() {
|
|
585
585
|
this.order_lines_by =
|
|
586
|
-
this.order_lines_by
|
|
586
|
+
this.order_lines_by === "priority" ? "location" : "priority";
|
|
587
587
|
return this.list_move_lines(this.current_picking_type().id);
|
|
588
588
|
},
|
|
589
589
|
list_move_lines(picking_type_id) {
|
|
@@ -594,7 +594,7 @@ const ZonePicking = {
|
|
|
594
594
|
return this.wait_call(this.odoo.call("list_move_lines", {}));
|
|
595
595
|
},
|
|
596
596
|
scan_source(barcode) {
|
|
597
|
-
|
|
597
|
+
const data = {
|
|
598
598
|
barcode: barcode,
|
|
599
599
|
confirmation: this.state.data.confirmation_required || "",
|
|
600
600
|
};
|
|
@@ -670,7 +670,7 @@ const ZonePicking = {
|
|
|
670
670
|
},
|
|
671
671
|
computed: {
|
|
672
672
|
sort_lines_by_btn_label() {
|
|
673
|
-
return this.order_lines_by
|
|
673
|
+
return this.order_lines_by === "priority"
|
|
674
674
|
? this.$t("order_lines_by.location")
|
|
675
675
|
: this.$t("order_lines_by.priority");
|
|
676
676
|
},
|
|
@@ -783,12 +783,11 @@ const ZonePicking = {
|
|
|
783
783
|
return "Scan product / lot";
|
|
784
784
|
}
|
|
785
785
|
return "Scan product";
|
|
786
|
-
} else {
|
|
787
|
-
if (this.any_line_with_lot()) {
|
|
788
|
-
return "Scan pack / product / lot";
|
|
789
|
-
}
|
|
790
|
-
return "Scan pack / product";
|
|
791
786
|
}
|
|
787
|
+
if (this.any_line_with_lot()) {
|
|
788
|
+
return "Scan pack / product / lot";
|
|
789
|
+
}
|
|
790
|
+
return "Scan pack / product";
|
|
792
791
|
}
|
|
793
792
|
if (this.any_line_with_lot()) {
|
|
794
793
|
return "Scan location / pack / product / lot";
|
|
@@ -817,8 +816,8 @@ const ZonePicking = {
|
|
|
817
816
|
while (!barcode) {
|
|
818
817
|
_.forEach(
|
|
819
818
|
["lot.name", "product.barcode", "location_src.barcode"],
|
|
820
|
-
function (
|
|
821
|
-
barcode = _.result(selected,
|
|
819
|
+
function (pth) {
|
|
820
|
+
barcode = _.result(selected, pth);
|
|
822
821
|
}
|
|
823
822
|
);
|
|
824
823
|
}
|
|
@@ -863,16 +862,14 @@ const ZonePicking = {
|
|
|
863
862
|
// Only locations are allowed.
|
|
864
863
|
display_info.scan_placeholder =
|
|
865
864
|
display_info.scan_placeholder_location;
|
|
865
|
+
} else if (full_qty === 0 || full_qty === false) {
|
|
866
|
+
// Only packages are allowed.
|
|
867
|
+
display_info.scan_placeholder =
|
|
868
|
+
display_info.scan_placeholder_package;
|
|
866
869
|
} else {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
display_info.
|
|
870
|
-
display_info.scan_placeholder_package;
|
|
871
|
-
} else {
|
|
872
|
-
// Both are allowed.
|
|
873
|
-
display_info.scan_placeholder =
|
|
874
|
-
display_info.scan_placeholder_full;
|
|
875
|
-
}
|
|
870
|
+
// Both are allowed.
|
|
871
|
+
display_info.scan_placeholder =
|
|
872
|
+
display_info.scan_placeholder_full;
|
|
876
873
|
}
|
|
877
874
|
},
|
|
878
875
|
on_scan: (scanned) => {
|
|
@@ -889,7 +886,7 @@ const ZonePicking = {
|
|
|
889
886
|
barcode: scanned.text,
|
|
890
887
|
quantity: quantity,
|
|
891
888
|
confirmation: data.confirmation_required || "",
|
|
892
|
-
//
|
|
889
|
+
// Package_id: data.is_complete_mix_pack ? data.move_line.package_src.id : null,
|
|
893
890
|
handle_complete_mix_pack: data.handle_complete_mix_pack,
|
|
894
891
|
})
|
|
895
892
|
);
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
* @author Simone Orsi <simahawk@gmail.com>
|
|
5
5
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
6
6
|
*/
|
|
7
|
-
import {utils_registry} from "/shopfloor_mobile_base/static/
|
|
7
|
+
import {utils_registry} from "/shopfloor_mobile_base/static/src/services/utils_registry.esm.js";
|
|
8
8
|
|
|
9
9
|
export class WMSUtils {
|
|
10
|
-
group_lines_by_location(lines,
|
|
10
|
+
group_lines_by_location(lines, opts) {
|
|
11
11
|
const self = this;
|
|
12
12
|
// {'key': 'no-group', 'title': '', 'records': []}
|
|
13
|
-
options = _.defaults(
|
|
13
|
+
const options = _.defaults(opts || {}, {
|
|
14
14
|
group_key: "location_src",
|
|
15
15
|
group_no_title: false,
|
|
16
16
|
name_prefix: "Location",
|
|
17
17
|
prepare_records: function (recs) {
|
|
18
18
|
return recs;
|
|
19
19
|
},
|
|
20
|
+
/* eslint-disable no-unused-vars */
|
|
20
21
|
group_color_maker: function (recs) {
|
|
21
22
|
return "";
|
|
22
23
|
},
|
|
@@ -32,11 +33,12 @@ export class WMSUtils {
|
|
|
32
33
|
// TODO: grouped.forEach?
|
|
33
34
|
_.forEach(grouped, function (value, loc_id) {
|
|
34
35
|
const location = _.first(_.filter(locations, {id: parseInt(loc_id, 10)}));
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
: location.name;
|
|
36
|
+
let title = location.name;
|
|
37
|
+
if (options.group_no_title) {
|
|
38
|
+
title = "";
|
|
39
|
+
} else if (options.name_prefix) {
|
|
40
|
+
title = options.name_prefix + ": " + location.name;
|
|
41
|
+
}
|
|
40
42
|
res.push({
|
|
41
43
|
_is_group: true,
|
|
42
44
|
key: loc_id,
|
|
@@ -48,10 +50,10 @@ export class WMSUtils {
|
|
|
48
50
|
return res;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
group_lines_by_locations(lines,
|
|
53
|
+
group_lines_by_locations(lines, opts) {
|
|
52
54
|
const self = this;
|
|
53
55
|
// {key: 'no-group', location_src: {}, location_dest: {} records: []}
|
|
54
|
-
options = _.defaults(
|
|
56
|
+
const options = _.defaults(opts || {}, {
|
|
55
57
|
prepare_records: function (recs) {
|
|
56
58
|
return recs;
|
|
57
59
|
},
|
|
@@ -86,10 +88,10 @@ export class WMSUtils {
|
|
|
86
88
|
return res;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
group_lines_by_product(lines,
|
|
91
|
+
group_lines_by_product(lines, opts) {
|
|
90
92
|
const self = this;
|
|
91
93
|
// {'key': 'no-group', 'title': '', 'records': []}
|
|
92
|
-
options = _.defaults(
|
|
94
|
+
const options = _.defaults(opts || {}, {
|
|
93
95
|
group_no_title: false,
|
|
94
96
|
prepare_records: function (recs) {
|
|
95
97
|
return recs;
|
|
@@ -101,18 +103,19 @@ export class WMSUtils {
|
|
|
101
103
|
const res = [];
|
|
102
104
|
const products = _.uniqBy(
|
|
103
105
|
_.map(lines, function (x) {
|
|
104
|
-
return x
|
|
106
|
+
return x.product;
|
|
105
107
|
}),
|
|
106
108
|
"id"
|
|
107
109
|
);
|
|
108
110
|
const grouped = _.groupBy(lines, "product.id");
|
|
109
111
|
_.forEach(grouped, function (value, prod_id) {
|
|
110
112
|
const product = _.first(_.filter(products, {id: parseInt(prod_id, 10)}));
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
: product.name
|
|
113
|
+
let title = product.name;
|
|
114
|
+
if (options.group_no_title) {
|
|
115
|
+
title = "";
|
|
116
|
+
} else if (options.name_prefix) {
|
|
117
|
+
title = `${options.name_prefix}: ${product.name}`;
|
|
118
|
+
}
|
|
116
119
|
res.push({
|
|
117
120
|
_is_group: true,
|
|
118
121
|
key: prod_id,
|
|
@@ -169,8 +172,8 @@ export class WMSUtils {
|
|
|
169
172
|
res.push({
|
|
170
173
|
_is_group: true,
|
|
171
174
|
// GroupBy gives undefined as string
|
|
172
|
-
key: packaging_name
|
|
173
|
-
title: packaging_name
|
|
175
|
+
key: packaging_name === "undefined" ? "no-packaging" : packaging_name,
|
|
176
|
+
title: packaging_name === "undefined" ? "" : packaging_name,
|
|
174
177
|
records: products,
|
|
175
178
|
});
|
|
176
179
|
});
|
|
@@ -201,7 +204,7 @@ export class WMSUtils {
|
|
|
201
204
|
const res = [];
|
|
202
205
|
grouped.forEach(function (group) {
|
|
203
206
|
if (group.pack) {
|
|
204
|
-
|
|
207
|
+
const single_line = group.records[0];
|
|
205
208
|
single_line._grouped_by_pack = true;
|
|
206
209
|
single_line._pack_lines = group.records;
|
|
207
210
|
res.push(single_line);
|
|
@@ -244,11 +247,11 @@ export class WMSUtils {
|
|
|
244
247
|
line = line.records[0];
|
|
245
248
|
}
|
|
246
249
|
let klass = "";
|
|
247
|
-
if (line.qty_done
|
|
250
|
+
if (line.qty_done === line.quantity) {
|
|
248
251
|
klass = "done screen_step_done lighten-1";
|
|
249
252
|
} else if (line.qty_done && line.qty_done < line.quantity) {
|
|
250
253
|
klass = "partial screen_step_todo lighten-2";
|
|
251
|
-
} else if (line.qty_done
|
|
254
|
+
} else if (line.qty_done === 0) {
|
|
252
255
|
klass = "not-done screen_step_todo lighten-1";
|
|
253
256
|
}
|
|
254
257
|
return "move-line-" + klass;
|
|
@@ -259,7 +262,7 @@ export class WMSUtils {
|
|
|
259
262
|
if (!records) {
|
|
260
263
|
return;
|
|
261
264
|
}
|
|
262
|
-
|
|
265
|
+
const avg_progress =
|
|
263
266
|
records.reduce((acc, next) => {
|
|
264
267
|
return next.progress + acc;
|
|
265
268
|
}, 0) / records.length;
|
|
@@ -283,7 +286,7 @@ export class WMSUtils {
|
|
|
283
286
|
*
|
|
284
287
|
* @param {*} line The move line
|
|
285
288
|
*/
|
|
286
|
-
move_line_product_detail_options(line,
|
|
289
|
+
move_line_product_detail_options(line, opts = {}) {
|
|
287
290
|
const self = this;
|
|
288
291
|
const default_fields = [
|
|
289
292
|
{path: "product.supplier_code", label: "Vendor code", klass: "loud"},
|
|
@@ -301,7 +304,7 @@ export class WMSUtils {
|
|
|
301
304
|
},
|
|
302
305
|
{path: "product.qty_available", label: "Qty on hand"},
|
|
303
306
|
];
|
|
304
|
-
options = _.defaults({},
|
|
307
|
+
const options = _.defaults({}, opts, {
|
|
305
308
|
main: true,
|
|
306
309
|
key_title: "product.display_name",
|
|
307
310
|
title_action_field: {
|