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,388 @@
|
|
|
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 LocationContentTransfer = {
|
|
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
|
+
/>
|
|
22
|
+
<template v-if="state_in(['scan_location']) && state.data.location">
|
|
23
|
+
<item-detail-card
|
|
24
|
+
:key="make_state_component_key(['detail-move-line-location', state.data.location.id])"
|
|
25
|
+
:record="state.data.location"
|
|
26
|
+
:options="{main: true, key_title: 'name', title_action_field: {action_val_path: 'name'}}"
|
|
27
|
+
:card_color="utils.colors.color_for('screen_step_done')"
|
|
28
|
+
/>
|
|
29
|
+
<div class="button-list button-vertical-list full">
|
|
30
|
+
<v-row align="center">
|
|
31
|
+
<v-col class="text-center" cols="12">
|
|
32
|
+
<cancel-button v-on:cancel="on_cancel"/>
|
|
33
|
+
</v-col>
|
|
34
|
+
</v-row>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<get-work
|
|
39
|
+
v-if="state_is('get_work')"
|
|
40
|
+
v-on:get_work="state.on_get_work"
|
|
41
|
+
v-on:manual_selection="state.on_manual_selection"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<div v-if="state_in(['start_single', 'scan_destination', 'scan_destination_all']) && wrapped_context().has_records">
|
|
45
|
+
|
|
46
|
+
<item-detail-card
|
|
47
|
+
v-if="wrapped_context().location_src"
|
|
48
|
+
:key="make_state_component_key(['detail-move-line-loc-src', wrapped_context().location_src.id])"
|
|
49
|
+
:record="wrapped_context().location_src"
|
|
50
|
+
:options="{main: true, key_title: 'name', title_action_field: {action_val_path: 'barcode'}}"
|
|
51
|
+
:card_color="utils.colors.color_for(state_in(['start_single', 'scan_destination', 'scan_destination_all']) ? 'screen_step_done': 'screen_step_todo')"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<div v-for="rec in wrapped_context().records">
|
|
55
|
+
|
|
56
|
+
<!--batch-picking-line-detail
|
|
57
|
+
:line="rec"
|
|
58
|
+
:key="make_state_component_key(['detail-move-line', rec.id])"
|
|
59
|
+
:article-scanned="state_is('scan_destination')"
|
|
60
|
+
:show-qty-picker="state_is('scan_destination')"
|
|
61
|
+
:default-destination-key="'location_dest'"
|
|
62
|
+
/-->
|
|
63
|
+
<!--
|
|
64
|
+
TODO: "batch-picking-line-detail" has some limitations which would require more tweaking on options.
|
|
65
|
+
No time ATM to do that but the big TODO is: rename picking-line-detail to generic name and make it a bit more configurable
|
|
66
|
+
eg: display source location or destination location, control colors by step, etc.
|
|
67
|
+
Hence for now, we copy paste its code here and customize it for this case.
|
|
68
|
+
-->
|
|
69
|
+
<item-detail-card
|
|
70
|
+
:key="make_state_component_key(['detail-move-line-product', rec.id])"
|
|
71
|
+
:record="rec"
|
|
72
|
+
:options="utils.wms.move_line_product_detail_options(rec, {fields: [{path: 'picking.name', label: 'Picking'}]})"
|
|
73
|
+
:card_color="utils.colors.color_for(state_in(['scan_destination', 'scan_destination_all']) ? 'screen_step_done': 'screen_step_todo')"
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
<v-card v-if="wrapped_context()._type == 'move_line' && state_is('scan_destination')"
|
|
77
|
+
class="pa-2" :color="utils.colors.color_for('screen_step_todo')">
|
|
78
|
+
<packaging-qty-picker
|
|
79
|
+
:key="make_state_component_key(['packaging-qty-picker', rec.id])"
|
|
80
|
+
v-bind="utils.wms.move_line_qty_picker_props(rec)"
|
|
81
|
+
/>
|
|
82
|
+
</v-card>
|
|
83
|
+
|
|
84
|
+
<line-actions-popup
|
|
85
|
+
v-if="!wrapped_context()._multi"
|
|
86
|
+
:line="rec"
|
|
87
|
+
:actions="line_actions()"
|
|
88
|
+
:key="make_state_component_key(['line-actions', rec.id])"
|
|
89
|
+
v-on:action="on_line_action"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<item-detail-card
|
|
94
|
+
v-if="wrapped_context().location_dest"
|
|
95
|
+
:key="make_state_component_key(['detail-move-line-loc-src', wrapped_context().location_dest.id])"
|
|
96
|
+
:record="wrapped_context().location_dest"
|
|
97
|
+
:options="{main: true, key_title: 'name', title_action_field: {action_val_path: 'barcode'}}"
|
|
98
|
+
:card_color="utils.colors.color_for('screen_step_todo')"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
<line-stock-out
|
|
103
|
+
v-if="state_is('stock_issue')"
|
|
104
|
+
v-on:confirm_stock_issue="state.on_confirm_stock_issue"
|
|
105
|
+
/>
|
|
106
|
+
<div class="button-list button-vertical-list full">
|
|
107
|
+
<v-row align="center" v-if="state_is('scan_destination_all')">
|
|
108
|
+
<v-col class="text-center" cols="12">
|
|
109
|
+
<btn-action @click="state.on_split_by_line">Process by line</btn-action>
|
|
110
|
+
</v-col>
|
|
111
|
+
</v-row>
|
|
112
|
+
</div>
|
|
113
|
+
</Screen>
|
|
114
|
+
`,
|
|
115
|
+
methods: {
|
|
116
|
+
screen_title: function () {
|
|
117
|
+
if (!this.has_picking()) return this.menu_item().name;
|
|
118
|
+
return this.current_picking().name;
|
|
119
|
+
},
|
|
120
|
+
// TODO: if we have this working we can remove the picking detail?
|
|
121
|
+
current_doc: function () {
|
|
122
|
+
const picking = this.current_picking();
|
|
123
|
+
return {
|
|
124
|
+
record: picking,
|
|
125
|
+
identifier: picking.name,
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
// TODO: ask Joél if this is needed
|
|
129
|
+
current_picking: function () {
|
|
130
|
+
const data = this.state_get_data("start");
|
|
131
|
+
if (_.isEmpty(data) || _.isEmpty(data.move_line.picking)) {
|
|
132
|
+
return {};
|
|
133
|
+
}
|
|
134
|
+
return data.move_line.picking;
|
|
135
|
+
},
|
|
136
|
+
has_picking: function () {
|
|
137
|
+
return !_.isEmpty(this.current_picking());
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* As we can get `move_line` or `package_level` for single items
|
|
141
|
+
* and `move_lines` or `package_levels` for multiple items,
|
|
142
|
+
* this function tries to make such data homogenous.
|
|
143
|
+
* We'll work alway with multiple records and loop on them.
|
|
144
|
+
* TODO: this should be computed to be cached.
|
|
145
|
+
*/
|
|
146
|
+
wrapped_context: function () {
|
|
147
|
+
const data = this.state.data;
|
|
148
|
+
const res = {
|
|
149
|
+
has_records: true,
|
|
150
|
+
records: [].concat(data.move_lines || [], data.package_levels || []),
|
|
151
|
+
location_src: null,
|
|
152
|
+
location_dest: null,
|
|
153
|
+
_multi: true,
|
|
154
|
+
_type: "mix",
|
|
155
|
+
};
|
|
156
|
+
if (_.isEmpty(res.records) && data.move_line) {
|
|
157
|
+
res.records = [data.move_line];
|
|
158
|
+
res._type = "move_line";
|
|
159
|
+
res._multi = false;
|
|
160
|
+
}
|
|
161
|
+
if (_.isEmpty(res.records) && data.package_level) {
|
|
162
|
+
res.records = [data.package_level];
|
|
163
|
+
res._type = "pkg_level";
|
|
164
|
+
res._multi = false;
|
|
165
|
+
}
|
|
166
|
+
res.has_records = res.records.length > 0;
|
|
167
|
+
res.location_src = res.has_records ? res.records[0].location_src : null;
|
|
168
|
+
res.location_dest = res.has_records ? res.records[0].location_dest : null;
|
|
169
|
+
return res;
|
|
170
|
+
},
|
|
171
|
+
move_line_detail_list_options: function (move_line) {
|
|
172
|
+
return this.utils.wms.move_line_product_detail_options(move_line, {
|
|
173
|
+
loud_labels: true,
|
|
174
|
+
fields_blacklist: ["product.qty_available"],
|
|
175
|
+
fields: [{path: "location_src.name", label: "From"}],
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
line_actions: function () {
|
|
179
|
+
const actions = [
|
|
180
|
+
{name: "Postpone line", event_name: "action_postpone"},
|
|
181
|
+
{name: "Declare stock out", event_name: "action_stock_out"},
|
|
182
|
+
];
|
|
183
|
+
if (this.state.data.package_level) {
|
|
184
|
+
actions.push({name: "Open Package", event_name: "action_open_package"});
|
|
185
|
+
}
|
|
186
|
+
return actions;
|
|
187
|
+
},
|
|
188
|
+
// Common actions
|
|
189
|
+
on_line_action: function (action) {
|
|
190
|
+
this["on_" + action.event_name].call(this);
|
|
191
|
+
},
|
|
192
|
+
on_action_postpone: function () {
|
|
193
|
+
let endpoint, endpoint_data;
|
|
194
|
+
const data = this.state.data;
|
|
195
|
+
if (data.package_level) {
|
|
196
|
+
endpoint = "postpone_package";
|
|
197
|
+
endpoint_data = {
|
|
198
|
+
package_level_id: data.package_level.id,
|
|
199
|
+
location_id: data.package_level.location_src.id,
|
|
200
|
+
};
|
|
201
|
+
} else {
|
|
202
|
+
endpoint = "postpone_line";
|
|
203
|
+
endpoint_data = {
|
|
204
|
+
move_line_id: data.move_line.id,
|
|
205
|
+
location_id: data.move_line.location_src.id,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
this.wait_call(this.odoo.call(endpoint, endpoint_data));
|
|
209
|
+
},
|
|
210
|
+
on_action_stock_out: function () {
|
|
211
|
+
this.state_set_data(this.state.data, "stock_issue");
|
|
212
|
+
this.state_to("stock_issue");
|
|
213
|
+
},
|
|
214
|
+
on_action_open_package: function () {
|
|
215
|
+
const data = this.state.data;
|
|
216
|
+
const endpoint_data = {
|
|
217
|
+
location_id: data.package_level.location_src.id,
|
|
218
|
+
package_level_id: data.package_level.id,
|
|
219
|
+
};
|
|
220
|
+
this.wait_call(this.odoo.call("dismiss_package_level", endpoint_data));
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
data: function () {
|
|
224
|
+
return {
|
|
225
|
+
usage: "location_content_transfer",
|
|
226
|
+
initial_state_key: "init",
|
|
227
|
+
scan_destination_qty: 0,
|
|
228
|
+
states: {
|
|
229
|
+
init: {
|
|
230
|
+
enter: () => {
|
|
231
|
+
this.wait_call(this.odoo.call("start_or_recover"));
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
get_work: {
|
|
235
|
+
on_get_work: (evt) => {
|
|
236
|
+
this.wait_call(this.odoo.call("find_work"));
|
|
237
|
+
},
|
|
238
|
+
on_manual_selection: (evt) => {
|
|
239
|
+
this.state_to("scan_location");
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
scan_location: {
|
|
243
|
+
display_info: {
|
|
244
|
+
title: this.$t("location_content_transfer.scan_location.title"),
|
|
245
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
246
|
+
},
|
|
247
|
+
on_cancel: () => {
|
|
248
|
+
this.state_reset_data("scan_location");
|
|
249
|
+
this.wait_call(
|
|
250
|
+
this.odoo.call("cancel_work", {
|
|
251
|
+
location_id: this.state.data.location.id,
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
},
|
|
255
|
+
on_scan: (scanned) => {
|
|
256
|
+
this.wait_call(
|
|
257
|
+
this.odoo.call("scan_location", {barcode: scanned.text})
|
|
258
|
+
);
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
scan_destination_all: {
|
|
262
|
+
display_info: {
|
|
263
|
+
title: this.$t(
|
|
264
|
+
"location_content_transfer.scan_destination_all.title"
|
|
265
|
+
),
|
|
266
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
267
|
+
},
|
|
268
|
+
on_scan: (scanned) => {
|
|
269
|
+
const data = this.state.data;
|
|
270
|
+
this.wait_call(
|
|
271
|
+
this.odoo.call("set_destination_all", {
|
|
272
|
+
location_id: data.location.id,
|
|
273
|
+
barcode: scanned.text,
|
|
274
|
+
confirmation: data.confirmation_required,
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
},
|
|
278
|
+
on_split_by_line: () => {
|
|
279
|
+
const location = this.state.data.location;
|
|
280
|
+
this.wait_call(
|
|
281
|
+
this.odoo.call("go_to_single", {location_id: location.id})
|
|
282
|
+
);
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
start_single: {
|
|
286
|
+
display_info: {
|
|
287
|
+
scan_placeholder: this.$t(
|
|
288
|
+
"location_content_transfer.start_single.scan_placeholder"
|
|
289
|
+
),
|
|
290
|
+
},
|
|
291
|
+
on_scan: (scanned) => {
|
|
292
|
+
let endpoint, endpoint_data;
|
|
293
|
+
const data = this.state.data;
|
|
294
|
+
if (data.package_level) {
|
|
295
|
+
endpoint = "scan_package";
|
|
296
|
+
endpoint_data = {
|
|
297
|
+
package_level_id: data.package_level.id,
|
|
298
|
+
location_id: data.package_level.location_src.id,
|
|
299
|
+
barcode: scanned.text,
|
|
300
|
+
};
|
|
301
|
+
} else {
|
|
302
|
+
endpoint = "scan_line";
|
|
303
|
+
endpoint_data = {
|
|
304
|
+
move_line_id: data.move_line.id,
|
|
305
|
+
location_id: data.move_line.location_src.id,
|
|
306
|
+
barcode: scanned.text,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
this.wait_call(this.odoo.call(endpoint, endpoint_data));
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
scan_destination: {
|
|
313
|
+
enter: () => {
|
|
314
|
+
this.reset_notification();
|
|
315
|
+
},
|
|
316
|
+
display_info: {
|
|
317
|
+
title: this.$t(
|
|
318
|
+
"location_content_transfer.scan_destination.title"
|
|
319
|
+
),
|
|
320
|
+
scan_placeholder: this.$t("scan_placeholder_translation"),
|
|
321
|
+
},
|
|
322
|
+
events: {
|
|
323
|
+
qty_edit: "on_qty_update",
|
|
324
|
+
},
|
|
325
|
+
on_qty_update: (qty) => {
|
|
326
|
+
this.scan_destination_qty = parseInt(qty, 10);
|
|
327
|
+
},
|
|
328
|
+
on_scan: (scanned) => {
|
|
329
|
+
let endpoint, endpoint_data;
|
|
330
|
+
const data = this.state.data;
|
|
331
|
+
if (data.package_level) {
|
|
332
|
+
endpoint = "set_destination_package";
|
|
333
|
+
endpoint_data = {
|
|
334
|
+
package_level_id: data.package_level.id,
|
|
335
|
+
location_id: data.package_level.location_src.id,
|
|
336
|
+
barcode: scanned.text,
|
|
337
|
+
confirmation: data.confirmation_required,
|
|
338
|
+
};
|
|
339
|
+
} else {
|
|
340
|
+
endpoint = "set_destination_line";
|
|
341
|
+
endpoint_data = {
|
|
342
|
+
move_line_id: data.move_line.id,
|
|
343
|
+
location_id: data.move_line.location_src.id,
|
|
344
|
+
barcode: scanned.text,
|
|
345
|
+
confirmation: data.confirmation_required,
|
|
346
|
+
quantity: this.scan_destination_qty,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
this.wait_call(this.odoo.call(endpoint, endpoint_data));
|
|
350
|
+
},
|
|
351
|
+
on_split_by_line: () => {
|
|
352
|
+
const location = this.state.data.move_lines[0].location_src;
|
|
353
|
+
this.wait_call(
|
|
354
|
+
this.odoo.call("go_to_single", {location_id: location.id})
|
|
355
|
+
);
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
stock_issue: {
|
|
359
|
+
enter: () => {
|
|
360
|
+
this.reset_notification();
|
|
361
|
+
},
|
|
362
|
+
on_confirm_stock_issue: () => {
|
|
363
|
+
let endpoint, endpoint_data;
|
|
364
|
+
const data = this.state.data;
|
|
365
|
+
if (data.package_level) {
|
|
366
|
+
endpoint = "stock_out_package";
|
|
367
|
+
endpoint_data = {
|
|
368
|
+
package_level_id: data.package_level.id,
|
|
369
|
+
location_id: data.package_level.location_src.id,
|
|
370
|
+
};
|
|
371
|
+
} else {
|
|
372
|
+
endpoint = "stock_out_line";
|
|
373
|
+
endpoint_data = {
|
|
374
|
+
move_line_id: data.move_line.id,
|
|
375
|
+
location_id: data.move_line.location_src.id,
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
this.wait_call(this.odoo.call(endpoint, endpoint_data));
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
process_registry.add("location_content_transfer", LocationContentTransfer);
|
|
387
|
+
|
|
388
|
+
export default LocationContentTransfer;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Akretion (http://www.akretion.com)
|
|
3
|
+
* @author Raphaël Reverdy <raphael.reverdy@akretion.com>
|
|
4
|
+
* Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
|
|
5
|
+
* @author Simone Orsi <simahawk@gmail.com>
|
|
6
|
+
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {ScenarioBaseMixin} from "/shopfloor_mobile_base/static/wms/src/scenario/mixins.js";
|
|
10
|
+
import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js";
|
|
11
|
+
|
|
12
|
+
export var SinglePackStatesMixin = {
|
|
13
|
+
data: function () {
|
|
14
|
+
return {
|
|
15
|
+
states: {
|
|
16
|
+
// Generic state for when to start w/ scanning a pack or loc
|
|
17
|
+
start: {
|
|
18
|
+
display_info: {
|
|
19
|
+
title: "Start by scanning a pack or a location",
|
|
20
|
+
scan_placeholder: "Scan pack",
|
|
21
|
+
},
|
|
22
|
+
on_scan: (scanned) => {
|
|
23
|
+
const data = this.state.data;
|
|
24
|
+
this.wait_call(
|
|
25
|
+
this.odoo.call("start", {
|
|
26
|
+
barcode: scanned.text,
|
|
27
|
+
confirmation: data.confirmation_required,
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
scan_location: {
|
|
33
|
+
display_info: {
|
|
34
|
+
title: "Set a location",
|
|
35
|
+
scan_placeholder: "Scan location",
|
|
36
|
+
show_cancel_button: true,
|
|
37
|
+
},
|
|
38
|
+
on_scan: (scanned, confirmation = false) => {
|
|
39
|
+
const data = this.state.data;
|
|
40
|
+
this.state_set_data({location_barcode: scanned.text});
|
|
41
|
+
this.wait_call(
|
|
42
|
+
this.odoo.call("validate", {
|
|
43
|
+
package_level_id: data.id,
|
|
44
|
+
location_barcode: scanned.text,
|
|
45
|
+
confirmation:
|
|
46
|
+
confirmation || data.confirmation_required,
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
on_cancel: () => {
|
|
51
|
+
this.wait_call(
|
|
52
|
+
this.odoo.call("cancel", {
|
|
53
|
+
package_level_id: this.state.data.id,
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const SinglePackTransfer = {
|
|
64
|
+
mixins: [ScenarioBaseMixin, SinglePackStatesMixin],
|
|
65
|
+
template: `
|
|
66
|
+
<Screen :screen_info="screen_info">
|
|
67
|
+
<template v-slot:header>
|
|
68
|
+
<state-display-info :info="state.display_info" v-if="state.display_info"/>
|
|
69
|
+
</template>
|
|
70
|
+
<searchbar v-if="state_is(initial_state_key)" v-on:found="on_scan" :input_placeholder="search_input_placeholder"></searchbar>
|
|
71
|
+
<searchbar v-if="state_is('scan_location')" v-on:found="on_scan" :input_placeholder="search_input_placeholder" :input_data_type="'location'"></searchbar>
|
|
72
|
+
<div v-if="state.key != 'show_completion_info' && _.result(state, 'data.picking')">
|
|
73
|
+
<item-detail-card
|
|
74
|
+
:key="make_state_component_key(['package', state.data.id])"
|
|
75
|
+
:record="state.data"
|
|
76
|
+
:card_color="utils.colors.color_for('screen_step_done')"
|
|
77
|
+
>
|
|
78
|
+
<template v-slot:after_details>
|
|
79
|
+
<v-card-subtitle>
|
|
80
|
+
<span class="font-weight-bold">Weight:</span>
|
|
81
|
+
<span>
|
|
82
|
+
{{ _get_pack_weight() }}
|
|
83
|
+
</span>
|
|
84
|
+
</v-card-subtitle>
|
|
85
|
+
<v-card-text class="details pt-0">
|
|
86
|
+
<div v-for="product in state.data.products" class="field-detail">
|
|
87
|
+
{{ product.display_name}}
|
|
88
|
+
</div>
|
|
89
|
+
</v-card-text>
|
|
90
|
+
</template>
|
|
91
|
+
</item-detail-card>
|
|
92
|
+
<item-detail-card
|
|
93
|
+
:key="make_state_component_key(['destination', state.data.id])"
|
|
94
|
+
:record="state.data"
|
|
95
|
+
:options="{main: true, key_title: 'location_dest.name', title_action_field: {action_val_path: 'location_dest.barcode'}}"
|
|
96
|
+
:card_color="utils.colors.color_for('screen_step_todo')"
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
<last-operation v-if="state_is('show_completion_info')" v-on:confirm="state.on_confirm"></last-operation>
|
|
100
|
+
<cancel-button v-on:cancel="on_cancel" v-if="show_cancel_button"></cancel-button>
|
|
101
|
+
</Screen>
|
|
102
|
+
`,
|
|
103
|
+
data: function () {
|
|
104
|
+
return {
|
|
105
|
+
usage: "single_pack_transfer",
|
|
106
|
+
show_reset_button: true,
|
|
107
|
+
initial_state_key: "start",
|
|
108
|
+
states: {
|
|
109
|
+
show_completion_info: {
|
|
110
|
+
on_confirm: () => {
|
|
111
|
+
// TODO: turn the cone?
|
|
112
|
+
this.state_to("start");
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
_get_pack_weight: function () {
|
|
120
|
+
let weight = this.state.data.weight;
|
|
121
|
+
let uom = this.state.data.weight_uom;
|
|
122
|
+
if (!weight) {
|
|
123
|
+
weight = this.state.data.estimated_weight_kg;
|
|
124
|
+
uom = "kg";
|
|
125
|
+
}
|
|
126
|
+
return weight.toFixed(3) + " " + uom;
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
process_registry.add("single_pack_transfer", SinglePackTransfer);
|
|
131
|
+
|
|
132
|
+
export default SinglePackTransfer;
|