odoo-addon-shopfloor-mobile 16.0.1.0.0.6__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.
- odoo/addons/shopfloor_mobile/README.rst +215 -0
- odoo/addons/shopfloor_mobile/__init__.py +0 -0
- odoo/addons/shopfloor_mobile/__manifest__.py +17 -0
- odoo/addons/shopfloor_mobile/i18n/es_AR.po +39 -0
- odoo/addons/shopfloor_mobile/i18n/pt_BR.po +14 -0
- odoo/addons/shopfloor_mobile/i18n/shopfloor_mobile.pot +13 -0
- odoo/addons/shopfloor_mobile/readme/CONTRIBUTORS.rst +12 -0
- odoo/addons/shopfloor_mobile/readme/CREDITS.rst +5 -0
- odoo/addons/shopfloor_mobile/readme/DESCRIPTION.rst +31 -0
- odoo/addons/shopfloor_mobile/readme/HISTORY.rst +4 -0
- odoo/addons/shopfloor_mobile/readme/ROADMAP.rst +29 -0
- odoo/addons/shopfloor_mobile/readme/USAGE.rst +34 -0
- odoo/addons/shopfloor_mobile/static/description/icon.png +0 -0
- odoo/addons/shopfloor_mobile/static/description/index.html +555 -0
- odoo/addons/shopfloor_mobile/static/wms/.gitignore +21 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/batch_picking_detail.js +69 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/batch_picking_line_detail.js +141 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_location.js +66 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_lot.js +91 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_operation.js +50 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_package.js +73 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_picking.js +40 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_product.js +70 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/detail/detail_transfer.js +128 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/forms/form_edit_stock_picking.js +39 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/manual_select_color.js +24 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/misc.js +201 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/packaging-qty-picker.js +329 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/mixins.js +130 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/picking_select.js +135 -0
- odoo/addons/shopfloor_mobile/static/wms/src/components/scenario_picking_detail/picking_summary.js +212 -0
- odoo/addons/shopfloor_mobile/static/wms/src/css/main.css +73 -0
- odoo/addons/shopfloor_mobile/static/wms/src/css/normalize.css +351 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.checkout.js +257 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.cluster_picking.js +188 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.delivery.js +79 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.location_content_transfer.js +179 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.scan_anything.js +124 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.single_pack_transfer.js +83 -0
- odoo/addons/shopfloor_mobile/static/wms/src/demo/demo.zone_picking.js +277 -0
- odoo/addons/shopfloor_mobile/static/wms/src/i18n/add_translations_to_registry.js +4 -0
- odoo/addons/shopfloor_mobile/static/wms/src/i18n/en.json +31 -0
- odoo/addons/shopfloor_mobile/static/wms/src/i18n/fr.json +27 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/checkout.js +390 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/checkout_states.js +380 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/cluster_picking.js +481 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/delivery.js +353 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/location_content_transfer.js +388 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/single_pack_transfer.js +132 -0
- odoo/addons/shopfloor_mobile/static/wms/src/scenario/zone_picking.js +838 -0
- odoo/addons/shopfloor_mobile/static/wms/src/screen.js +36 -0
- odoo/addons/shopfloor_mobile/static/wms/src/wms_utils.js +318 -0
- odoo/addons/shopfloor_mobile/templates/assets.xml +180 -0
- odoo_addon_shopfloor_mobile-16.0.1.0.0.6.dist-info/METADATA +235 -0
- odoo_addon_shopfloor_mobile-16.0.1.0.0.6.dist-info/RECORD +57 -0
- odoo_addon_shopfloor_mobile-16.0.1.0.0.6.dist-info/WHEEL +5 -0
- odoo_addon_shopfloor_mobile-16.0.1.0.0.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
|
|
3
|
+
* @author Simone Orsi <simahawk@gmail.com>
|
|
4
|
+
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/wms/src/scenario/mixins.js";
|
|
8
|
+
import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js";
|
|
9
|
+
|
|
10
|
+
const ClusterPicking = {
|
|
11
|
+
mixins: [ScenarioBaseMixin],
|
|
12
|
+
template: `
|
|
13
|
+
<Screen :screen_info="screen_info">
|
|
14
|
+
<template v-slot:header>
|
|
15
|
+
<state-display-info :info="state.display_info" v-if="state.display_info"/>
|
|
16
|
+
</template>
|
|
17
|
+
<searchbar
|
|
18
|
+
v-if="state.on_scan"
|
|
19
|
+
v-on:found="on_scan"
|
|
20
|
+
:input_placeholder="search_input_placeholder"
|
|
21
|
+
:input_type="searchbar_input_type"
|
|
22
|
+
:input_model="searchbar_input_type"
|
|
23
|
+
/>
|
|
24
|
+
<get-work
|
|
25
|
+
v-if="state_is('start')"
|
|
26
|
+
v-on:get_work="state.on_get_work"
|
|
27
|
+
v-on:manual_selection="state.on_manual_selection"
|
|
28
|
+
/>
|
|
29
|
+
<batch-picking-detail
|
|
30
|
+
v-if="state_is('confirm_start')"
|
|
31
|
+
:record="state.data"
|
|
32
|
+
v-on:confirm="state.on_confirm"
|
|
33
|
+
v-on:cancel="state.on_cancel"
|
|
34
|
+
/>
|
|
35
|
+
<batch-picking-line-detail
|
|
36
|
+
v-if="state_in(['start_line', 'scan_destination', 'change_pack_lot', 'stock_issue'])"
|
|
37
|
+
:line="state.data"
|
|
38
|
+
:article-scanned="state_is('scan_destination')"
|
|
39
|
+
:show-qty-picker="state_is('scan_destination')"
|
|
40
|
+
/>
|
|
41
|
+
<batch-picking-line-actions
|
|
42
|
+
v-if="state_is('start_line')"
|
|
43
|
+
v-on:action="state.on_action"
|
|
44
|
+
:line="state_get_data('start_line')"
|
|
45
|
+
/>
|
|
46
|
+
<div v-if="state_is('scan_destination')">
|
|
47
|
+
<div class="button-list button-vertical-list full mt-10">
|
|
48
|
+
<v-row align="center">
|
|
49
|
+
<v-col class="text-center" cols="12">
|
|
50
|
+
<v-btn color="primary" @click="state.on_action_full_bin" v-if="!state.data.disable_full_bin_action">
|
|
51
|
+
Full bin
|
|
52
|
+
</v-btn>
|
|
53
|
+
<v-btn color="default" disabled v-else="">
|
|
54
|
+
<v-icon color="warning" class="pr-1">mdi-block-helper</v-icon>
|
|
55
|
+
Full bin disabled by menu
|
|
56
|
+
</v-btn>
|
|
57
|
+
</v-col>
|
|
58
|
+
</v-row>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<stock-zero-check
|
|
62
|
+
v-if="state_is('zero_check')"
|
|
63
|
+
v-on:action="state.on_action"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<line-stock-out
|
|
67
|
+
v-if="state_is('stock_issue')"
|
|
68
|
+
v-on:confirm_stock_issue="state.on_confirm_stock_issue"
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<div v-if="state_is('manual_selection')">
|
|
72
|
+
<manual-select
|
|
73
|
+
v-on:select="state.on_select"
|
|
74
|
+
v-on:back="state.on_back"
|
|
75
|
+
:records="state.data.records"
|
|
76
|
+
:list_item_fields="manual_select_picking_fields"
|
|
77
|
+
/>
|
|
78
|
+
<div class="button-list button-vertical-list full">
|
|
79
|
+
<v-row align="center">
|
|
80
|
+
<v-col class="text-center" cols="12">
|
|
81
|
+
<v-btn color="default" @click="state.on_back">Back</v-btn>
|
|
82
|
+
</v-col>
|
|
83
|
+
</v-row>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="unload-all" v-if="state_is('unload_all')">
|
|
88
|
+
<item-detail-card
|
|
89
|
+
v-if="current_carrier()"
|
|
90
|
+
:card_color="utils.colors.color_for('success')"
|
|
91
|
+
:key="make_state_component_key(['batch-picking', state.data.id])"
|
|
92
|
+
:record="current_carrier()"
|
|
93
|
+
:options="{main: true, key_title: 'name', title_icon: 'mdi-truck-outline'}"
|
|
94
|
+
/>
|
|
95
|
+
<v-card class="main">
|
|
96
|
+
<v-card-title>
|
|
97
|
+
<div class="main-info">
|
|
98
|
+
<div class="destination">
|
|
99
|
+
<span class="label">Destination:</span>
|
|
100
|
+
{{ state.data.location_dest.name }}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</v-card-title>
|
|
104
|
+
</v-card>
|
|
105
|
+
<div class="button-list button-vertical-list full">
|
|
106
|
+
<v-row align="center">
|
|
107
|
+
<v-col class="text-center" cols="12">
|
|
108
|
+
<v-btn color="primary" @click="$emit('action', 'action_split')">Split [TODO]</v-btn>
|
|
109
|
+
</v-col>
|
|
110
|
+
</v-row>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div class="button-list button-vertical-list full">
|
|
115
|
+
<v-row align="center" v-if="state_in(['unload_all', 'change_pack_lot'])">
|
|
116
|
+
<v-col class="text-center" cols="12">
|
|
117
|
+
<btn-back />
|
|
118
|
+
</v-col>
|
|
119
|
+
</v-row>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
</Screen>
|
|
123
|
+
`,
|
|
124
|
+
computed: {
|
|
125
|
+
manual_select_picking_fields: function () {
|
|
126
|
+
return [
|
|
127
|
+
{path: "picking_count", label: "Operations"},
|
|
128
|
+
{path: "move_line_count", label: "Lines"},
|
|
129
|
+
];
|
|
130
|
+
},
|
|
131
|
+
searchbar_input_type: function () {
|
|
132
|
+
return "text";
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
methods: {
|
|
136
|
+
current_carrier: function () {
|
|
137
|
+
const pick = this.current_picking();
|
|
138
|
+
if (!pick) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return pick.carrier || pick.ship_carrier;
|
|
142
|
+
},
|
|
143
|
+
screen_title: function () {
|
|
144
|
+
if (_.isEmpty(this.current_batch()) || this.state_is("confirm_start"))
|
|
145
|
+
return this.menu_item().name;
|
|
146
|
+
let title = this.current_batch().name;
|
|
147
|
+
const picking = this.current_picking();
|
|
148
|
+
if (picking) {
|
|
149
|
+
title += " > " + picking.name;
|
|
150
|
+
}
|
|
151
|
+
return title;
|
|
152
|
+
},
|
|
153
|
+
current_batch: function () {
|
|
154
|
+
return this.state_get_data("confirm_start");
|
|
155
|
+
},
|
|
156
|
+
current_picking: function () {
|
|
157
|
+
const data = this.state_get_data("start_line") || {};
|
|
158
|
+
if (!data.picking) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return data.picking;
|
|
162
|
+
},
|
|
163
|
+
current_doc: function () {
|
|
164
|
+
const picking = this.current_picking();
|
|
165
|
+
if (!picking) {
|
|
166
|
+
return {};
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
record: picking,
|
|
170
|
+
identifier: picking.name,
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
action_full_bin: function () {
|
|
174
|
+
this.wait_call(
|
|
175
|
+
this.odoo.call("prepare_unload", {
|
|
176
|
+
picking_batch_id: this.current_batch().id,
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
data: function () {
|
|
182
|
+
// TODO: add a title to each screen
|
|
183
|
+
return {
|
|
184
|
+
usage: "cluster_picking",
|
|
185
|
+
initial_state_key: "start",
|
|
186
|
+
scan_destination_qty: 0,
|
|
187
|
+
states: {
|
|
188
|
+
start: {
|
|
189
|
+
on_get_work: (evt) => {
|
|
190
|
+
this.wait_call(this.odoo.call("find_batch"));
|
|
191
|
+
},
|
|
192
|
+
on_manual_selection: (evt) => {
|
|
193
|
+
this.wait_call(this.odoo.call("list_batch"));
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
manual_selection: {
|
|
197
|
+
on_back: () => {
|
|
198
|
+
this.state_to("start");
|
|
199
|
+
this.reset_notification();
|
|
200
|
+
},
|
|
201
|
+
on_select: (selected) => {
|
|
202
|
+
this.wait_call(
|
|
203
|
+
this.odoo.call("select", {
|
|
204
|
+
picking_batch_id: selected.id,
|
|
205
|
+
})
|
|
206
|
+
);
|
|
207
|
+
},
|
|
208
|
+
display_info: {
|
|
209
|
+
title: this.$t("cluster_picking.manual_selection.title"),
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
confirm_start: {
|
|
213
|
+
on_confirm: () => {
|
|
214
|
+
this.wait_call(
|
|
215
|
+
this.odoo.call("confirm_start", {
|
|
216
|
+
picking_batch_id: this.current_batch().id,
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
},
|
|
220
|
+
on_cancel: () => {
|
|
221
|
+
const self = this;
|
|
222
|
+
this.wait_call(
|
|
223
|
+
this.odoo.call("unassign", {
|
|
224
|
+
picking_batch_id: this.current_batch().id,
|
|
225
|
+
})
|
|
226
|
+
).then(function () {
|
|
227
|
+
self.state_reset_data_all();
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
start_line: {
|
|
232
|
+
display_info: {
|
|
233
|
+
title: this.$t("cluster_picking.start_line.title"),
|
|
234
|
+
scan_placeholder: () => {
|
|
235
|
+
const sublocation = this.state.data.sublocation;
|
|
236
|
+
if (
|
|
237
|
+
this.state.data.scan_location_or_pack_first &&
|
|
238
|
+
!sublocation
|
|
239
|
+
) {
|
|
240
|
+
return this.$t(
|
|
241
|
+
"cluster_picking.start_line.scan_placeholder_location_pack"
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
if (sublocation) {
|
|
245
|
+
return this.$t(
|
|
246
|
+
"cluster_picking.start_line.scan_placeholder_product_lot_pack"
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
return this.$t(
|
|
250
|
+
"cluster_picking.start_line.scan_placeholder"
|
|
251
|
+
);
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
// Here we have to use some info sent back from `select`
|
|
255
|
+
// or from `find_batch` that we pass to scan line
|
|
256
|
+
on_scan: (scanned) => {
|
|
257
|
+
const data = {
|
|
258
|
+
picking_batch_id: this.current_batch().id,
|
|
259
|
+
move_line_id: this.state.data.id,
|
|
260
|
+
barcode: scanned.text,
|
|
261
|
+
};
|
|
262
|
+
if (
|
|
263
|
+
this.state_is("start_line") &&
|
|
264
|
+
this.state.data.sublocation
|
|
265
|
+
) {
|
|
266
|
+
data.sublocation_id = this.state.data.sublocation.id;
|
|
267
|
+
}
|
|
268
|
+
this.wait_call(this.odoo.call("scan_line", data));
|
|
269
|
+
},
|
|
270
|
+
// Additional actions
|
|
271
|
+
on_action: (action) => {
|
|
272
|
+
this.state["on_" + action].call(this);
|
|
273
|
+
},
|
|
274
|
+
on_action_full_bin: () => {
|
|
275
|
+
this.action_full_bin();
|
|
276
|
+
},
|
|
277
|
+
on_action_skip_line: () => {
|
|
278
|
+
this.wait_call(
|
|
279
|
+
this.odoo.call("skip_line", {
|
|
280
|
+
picking_batch_id: this.current_batch().id,
|
|
281
|
+
move_line_id: this.state.data.id,
|
|
282
|
+
})
|
|
283
|
+
);
|
|
284
|
+
},
|
|
285
|
+
on_action_stock_out: () => {
|
|
286
|
+
this.state_set_data(this.state.data, "stock_issue");
|
|
287
|
+
this.state_to("stock_issue");
|
|
288
|
+
},
|
|
289
|
+
on_action_change_pack_or_lot: () => {
|
|
290
|
+
this.state_set_data(this.state.data, "change_pack_lot");
|
|
291
|
+
this.state_to("change_pack_lot");
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
scan_destination: {
|
|
295
|
+
display_info: {
|
|
296
|
+
title: this.$t("cluster_picking.scan_destination.title"),
|
|
297
|
+
scan_placeholder: this.$t(
|
|
298
|
+
"cluster_picking.scan_destination.scan_placeholder"
|
|
299
|
+
),
|
|
300
|
+
},
|
|
301
|
+
events: {
|
|
302
|
+
qty_edit: "on_qty_edit",
|
|
303
|
+
},
|
|
304
|
+
enter: () => {
|
|
305
|
+
// TODO: shalle we hook v-model for qty input straight to the state data?
|
|
306
|
+
this.scan_destination_qty =
|
|
307
|
+
this.state_get_data("start_line").quantity;
|
|
308
|
+
},
|
|
309
|
+
on_qty_edit: (qty) => {
|
|
310
|
+
this.scan_destination_qty = parseInt(qty, 10);
|
|
311
|
+
},
|
|
312
|
+
on_scan: (scanned) => {
|
|
313
|
+
this.wait_call(
|
|
314
|
+
this.odoo.call("scan_destination_pack", {
|
|
315
|
+
picking_batch_id: this.current_batch().id,
|
|
316
|
+
move_line_id: this.state.data.id,
|
|
317
|
+
barcode: scanned.text,
|
|
318
|
+
quantity: this.scan_destination_qty,
|
|
319
|
+
})
|
|
320
|
+
);
|
|
321
|
+
},
|
|
322
|
+
on_action_full_bin: () => {
|
|
323
|
+
this.action_full_bin();
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
zero_check: {
|
|
327
|
+
on_action: (action) => {
|
|
328
|
+
this.state["on_" + action].call(this);
|
|
329
|
+
},
|
|
330
|
+
on_action_confirm_zero: () => {
|
|
331
|
+
this.wait_call(
|
|
332
|
+
this.odoo.call("is_zero", {
|
|
333
|
+
picking_batch_id: this.current_batch().id,
|
|
334
|
+
move_line_id: this.state.data.id,
|
|
335
|
+
zero: true,
|
|
336
|
+
})
|
|
337
|
+
);
|
|
338
|
+
},
|
|
339
|
+
on_action_confirm_not_zero: () => {
|
|
340
|
+
this.wait_call(
|
|
341
|
+
this.odoo.call("is_zero", {
|
|
342
|
+
picking_batch_id: this.current_batch().id,
|
|
343
|
+
move_line_id: this.state.data.id,
|
|
344
|
+
zero: false,
|
|
345
|
+
})
|
|
346
|
+
);
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
unload_all: {
|
|
350
|
+
display_info: {
|
|
351
|
+
title: this.$t("cluster_picking.unload_all.title"),
|
|
352
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
353
|
+
},
|
|
354
|
+
on_scan: (scanned, confirmation = false) => {
|
|
355
|
+
this.state_set_data({location_barcode: scanned.text});
|
|
356
|
+
this.wait_call(
|
|
357
|
+
this.odoo.call("set_destination_all", {
|
|
358
|
+
picking_batch_id: this.current_batch().id,
|
|
359
|
+
barcode: scanned.text,
|
|
360
|
+
confirmation: confirmation,
|
|
361
|
+
})
|
|
362
|
+
);
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
confirm_unload_all: {
|
|
366
|
+
display_info: {
|
|
367
|
+
title: this.$t("cluster_picking.confirm_unload_all.title"),
|
|
368
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
369
|
+
},
|
|
370
|
+
on_user_confirm: (answer) => {
|
|
371
|
+
// TODO: check if this used
|
|
372
|
+
// -> no flag is set to enable the confirmation dialog,
|
|
373
|
+
// we only display a message, unlike `confirm_start`
|
|
374
|
+
if (answer == "yes") {
|
|
375
|
+
// Reuse data from unload_all
|
|
376
|
+
const scan_data = this.state_get_data("unload_all");
|
|
377
|
+
this.state.on_scan(scan_data.location_barcode, true);
|
|
378
|
+
} else {
|
|
379
|
+
this.state_to("scan_destination");
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
on_scan: (scanned, confirmation = true) => {
|
|
383
|
+
this.on_state_exit();
|
|
384
|
+
// FIXME: use state_load or traverse the state
|
|
385
|
+
// this.current_state_key = "unload_all";
|
|
386
|
+
// this.state.on_scan(scanned, confirmation);
|
|
387
|
+
this.states.unload_all.on_scan(scanned, confirmation);
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
unload_single: {
|
|
391
|
+
display_info: {
|
|
392
|
+
title: this.$t("cluster_picking.unload_single.title"),
|
|
393
|
+
scan_placeholder: this.$t(
|
|
394
|
+
"cluster_picking.scan_destination.scan_placeholder"
|
|
395
|
+
),
|
|
396
|
+
},
|
|
397
|
+
on_scan: (scanned) => {
|
|
398
|
+
this.wait_call(
|
|
399
|
+
this.odoo.call("unload_scan_pack", {
|
|
400
|
+
picking_batch_id: this.current_batch().id,
|
|
401
|
+
package_id: this.state.data.package.id,
|
|
402
|
+
barcode: scanned.text,
|
|
403
|
+
})
|
|
404
|
+
);
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
unload_set_destination: {
|
|
408
|
+
display_info: {
|
|
409
|
+
title: this.$t("cluster_picking.unload_set_destination.title"),
|
|
410
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
411
|
+
},
|
|
412
|
+
on_scan: (scanned) => {
|
|
413
|
+
this.wait_call(
|
|
414
|
+
this.odoo.call("unload_scan_destination", {
|
|
415
|
+
picking_batch_id: this.current_batch().id,
|
|
416
|
+
package_id: this.state.data.package.id,
|
|
417
|
+
barcode: scanned.text,
|
|
418
|
+
})
|
|
419
|
+
);
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
confirm_unload_set_destination: {
|
|
423
|
+
display_info: {
|
|
424
|
+
title: this.$t(
|
|
425
|
+
"cluster_picking.confirm_unload_set_destination.title"
|
|
426
|
+
),
|
|
427
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
428
|
+
},
|
|
429
|
+
on_scan: (scanned) => {
|
|
430
|
+
this.wait_call(
|
|
431
|
+
this.odoo.call("unload_scan_destination", {
|
|
432
|
+
picking_batch_id: this.current_batch().id,
|
|
433
|
+
package_id: null, // FIXME: where does it come from? backend data?
|
|
434
|
+
barcode: scanned.text,
|
|
435
|
+
confirmation: true,
|
|
436
|
+
})
|
|
437
|
+
);
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
change_pack_lot: {
|
|
441
|
+
display_info: {
|
|
442
|
+
title: this.$t("cluster_picking.change_pack_lot.title"),
|
|
443
|
+
scan_placeholder: this.$t(
|
|
444
|
+
"cluster_picking.change_pack_lot.scan_placeholder"
|
|
445
|
+
),
|
|
446
|
+
},
|
|
447
|
+
on_scan: (scanned) => {
|
|
448
|
+
const quantity =
|
|
449
|
+
this.scan_destination ||
|
|
450
|
+
this.state_get_data("start_line").quantity;
|
|
451
|
+
this.wait_call(
|
|
452
|
+
this.odoo.call("change_pack_lot", {
|
|
453
|
+
picking_batch_id: this.current_batch().id,
|
|
454
|
+
move_line_id: this.state.data.id,
|
|
455
|
+
barcode: scanned.text,
|
|
456
|
+
quantity: quantity,
|
|
457
|
+
})
|
|
458
|
+
);
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
stock_issue: {
|
|
462
|
+
enter: () => {
|
|
463
|
+
this.reset_notification();
|
|
464
|
+
},
|
|
465
|
+
on_confirm_stock_issue: () => {
|
|
466
|
+
this.wait_call(
|
|
467
|
+
this.odoo.call("stock_issue", {
|
|
468
|
+
picking_batch_id: this.current_batch().id,
|
|
469
|
+
move_line_id: this.state.data.id,
|
|
470
|
+
})
|
|
471
|
+
);
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
},
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
process_registry.add("cluster_picking", ClusterPicking);
|
|
480
|
+
|
|
481
|
+
export default ClusterPicking;
|