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,353 @@
|
|
|
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 Delivery = {
|
|
11
|
+
mixins: [ScenarioBaseMixin],
|
|
12
|
+
template: `
|
|
13
|
+
<Screen :screen_info="screen_info">
|
|
14
|
+
<template v-slot:header>
|
|
15
|
+
<state-display-info :info="current_location_msg()" v-if="current_location()"/>
|
|
16
|
+
<state-display-info :info="state.display_info" v-if="state.display_info"/>
|
|
17
|
+
</template>
|
|
18
|
+
<searchbar
|
|
19
|
+
v-if="state.on_scan"
|
|
20
|
+
v-on:found="on_scan"
|
|
21
|
+
:input_placeholder="search_input_placeholder"
|
|
22
|
+
/>
|
|
23
|
+
<div v-if="state_in(['deliver', 'confirm_done']) && has_picking()">
|
|
24
|
+
<picking-summary
|
|
25
|
+
:record="state.data.picking"
|
|
26
|
+
:records_grouped="deliver_picking_summary_records_grouped(state.data.picking)"
|
|
27
|
+
:action_cancel_package_key="'package_src'"
|
|
28
|
+
:list_options="deliver_move_line_list_options(state.data.picking)"
|
|
29
|
+
:key="make_state_component_key(['picking-summary', 'detail-picking', state.data.picking.id])"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="state_is('deliver') && display_location_operations_progress()">
|
|
33
|
+
<item-detail-card
|
|
34
|
+
:key="make_state_component_key(['deliver-operations-progress', state.data.sublocation.id])"
|
|
35
|
+
:record="state.data.sublocation.operation_progress"
|
|
36
|
+
:options="detail_card_location_operation_progress_options()"
|
|
37
|
+
:card_color="detail_card_location_operation_progress_color()"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
<div v-if="state_is('manual_selection')">
|
|
41
|
+
<manual-select
|
|
42
|
+
class="with-progress-bar"
|
|
43
|
+
:records="state.visible_records(this.state.data.pickings)"
|
|
44
|
+
:options="manual_select_options()"
|
|
45
|
+
:key="make_state_component_key(['delivery', 'manual-select'])"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="button-list button-vertical-list full">
|
|
49
|
+
<v-row align="center" v-if="state_is('deliver') && is_current_location_set()">
|
|
50
|
+
<v-col class="text-center" cols="12">
|
|
51
|
+
<btn-action @click="reset_current_location">Reset location</btn-action>
|
|
52
|
+
</v-col>
|
|
53
|
+
</v-row>
|
|
54
|
+
<v-row align="center" v-if="state_is('deliver') && has_picking()">
|
|
55
|
+
<v-col class="text-center" cols="12">
|
|
56
|
+
<btn-action @click="state.on_mark_as_done">Make partial delivery</btn-action>
|
|
57
|
+
</v-col>
|
|
58
|
+
</v-row>
|
|
59
|
+
<v-row align="center" v-if="state_in([initial_state_key, 'deliver'])">
|
|
60
|
+
<v-col class="text-center" cols="12">
|
|
61
|
+
<btn-action @click="state.on_manual_selection">Manual selection</btn-action>
|
|
62
|
+
</v-col>
|
|
63
|
+
</v-row>
|
|
64
|
+
<v-row align="center" v-if="state_is('confirm_done')">
|
|
65
|
+
<v-col class="text-center" cols="12">
|
|
66
|
+
<btn-action action="todo" @click="state.on_confirm">Confirm</btn-action>
|
|
67
|
+
</v-col>
|
|
68
|
+
</v-row>
|
|
69
|
+
<v-row align="center" v-if="state_in(['confirm_done'])">
|
|
70
|
+
<v-col class="text-center" cols="12">
|
|
71
|
+
<btn-back />
|
|
72
|
+
</v-col>
|
|
73
|
+
</v-row>
|
|
74
|
+
</div>
|
|
75
|
+
</Screen>
|
|
76
|
+
`,
|
|
77
|
+
methods: {
|
|
78
|
+
screen_title: function () {
|
|
79
|
+
if (_.isEmpty(this.current_doc()) || this.state_is(this.initial_state_key))
|
|
80
|
+
return this.menu_item().name;
|
|
81
|
+
return this.current_picking().name;
|
|
82
|
+
},
|
|
83
|
+
current_doc: function () {
|
|
84
|
+
const picking = this.current_picking();
|
|
85
|
+
return {
|
|
86
|
+
record: picking,
|
|
87
|
+
identifier: picking.name,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
current_picking: function () {
|
|
91
|
+
const data = this.state_get_data("deliver");
|
|
92
|
+
if (_.isEmpty(data) || _.isEmpty(data.picking)) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
return data.picking;
|
|
96
|
+
},
|
|
97
|
+
current_location: function () {
|
|
98
|
+
const data = this.state_get_data("deliver");
|
|
99
|
+
if (_.isEmpty(data) || _.isEmpty(data.sublocation)) {
|
|
100
|
+
return {};
|
|
101
|
+
}
|
|
102
|
+
return data.sublocation;
|
|
103
|
+
},
|
|
104
|
+
is_current_location_set: function () {
|
|
105
|
+
return !_.isEmpty(this.current_location());
|
|
106
|
+
},
|
|
107
|
+
reset_current_location: function () {
|
|
108
|
+
this.wait_call(
|
|
109
|
+
this.odoo.call("scan_deliver", {
|
|
110
|
+
barcode: "",
|
|
111
|
+
picking_id: this.current_picking().id,
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
current_location_msg: function () {
|
|
116
|
+
if (this.current_location().id) {
|
|
117
|
+
return {title: "Working from location " + this.current_location().name};
|
|
118
|
+
}
|
|
119
|
+
return {};
|
|
120
|
+
},
|
|
121
|
+
has_picking: function () {
|
|
122
|
+
return !_.isEmpty(this.current_picking());
|
|
123
|
+
},
|
|
124
|
+
deliver_picking_summary_records_grouped(picking) {
|
|
125
|
+
const self = this;
|
|
126
|
+
return this.utils.wms.group_lines_by_location(picking.move_lines, {
|
|
127
|
+
prepare_records: _.partialRight(
|
|
128
|
+
this.utils.wms.group_by_pack,
|
|
129
|
+
"package_src"
|
|
130
|
+
),
|
|
131
|
+
group_color_maker: function (lines) {
|
|
132
|
+
return self.utils.wms.move_lines_completeness(lines) == 100
|
|
133
|
+
? "screen_step_done"
|
|
134
|
+
: "screen_step_todo";
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
deliver_move_line_list_options: function (picking) {
|
|
139
|
+
return {
|
|
140
|
+
list_item_options: {
|
|
141
|
+
actions: ["action_cancel_line"],
|
|
142
|
+
fields: this.move_line_detail_fields(),
|
|
143
|
+
list_item_klass_maker: this.utils.wms.move_line_color_klass,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
move_line_detail_fields: function () {
|
|
148
|
+
return [{path: "package_src.name", klass: "loud"}];
|
|
149
|
+
},
|
|
150
|
+
display_location_operations_progress: function () {
|
|
151
|
+
const operation_progress = this._get_operation_progress_data();
|
|
152
|
+
if (operation_progress) {
|
|
153
|
+
return operation_progress.to_do > 0;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
detail_card_location_operation_progress_options: function () {
|
|
157
|
+
return {
|
|
158
|
+
no_title: true,
|
|
159
|
+
fields: [
|
|
160
|
+
{
|
|
161
|
+
path: "to_do",
|
|
162
|
+
klass: "loud",
|
|
163
|
+
label: "Available",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
path: "done",
|
|
167
|
+
klass: "loud",
|
|
168
|
+
label: "Ongoing",
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
detail_card_location_operation_progress_color: function () {
|
|
174
|
+
const operation_progress = this._get_operation_progress_data();
|
|
175
|
+
if (operation_progress.done === operation_progress.to_do) {
|
|
176
|
+
return this.utils.colors.color_for("screen_step_done");
|
|
177
|
+
} else {
|
|
178
|
+
return this.utils.colors.color_for("screen_step_todo");
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
_get_operation_progress_data: function () {
|
|
182
|
+
return _.result(this.state, "data.sublocation.operation_progress", false);
|
|
183
|
+
},
|
|
184
|
+
manual_select_options: function () {
|
|
185
|
+
return {
|
|
186
|
+
show_title: false,
|
|
187
|
+
showActions: false,
|
|
188
|
+
group_title_default: "Pickings to process",
|
|
189
|
+
group_color: this.utils.colors.color_for("screen_step_todo"),
|
|
190
|
+
list_item_extra_component: "picking-list-item-progress-bar",
|
|
191
|
+
list_item_options: {
|
|
192
|
+
fields: this.manual_select_picking_fields(),
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
manual_select_picking_fields: function () {
|
|
197
|
+
const self = this;
|
|
198
|
+
return [
|
|
199
|
+
{path: "name", klass: "loud", action_val_path: "name"},
|
|
200
|
+
{path: "partner.name"},
|
|
201
|
+
{path: "origin"},
|
|
202
|
+
{
|
|
203
|
+
path: "move_line_count",
|
|
204
|
+
label: "Lines",
|
|
205
|
+
renderer: function (rec, field) {
|
|
206
|
+
return (
|
|
207
|
+
self.utils.wms.completed_move_lines(rec.move_lines) +
|
|
208
|
+
" / " +
|
|
209
|
+
rec.move_lines.length
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
];
|
|
214
|
+
},
|
|
215
|
+
existing_package_select_fields: function () {
|
|
216
|
+
return [
|
|
217
|
+
{path: "weight"},
|
|
218
|
+
{path: "move_line_count", label: "Line count"},
|
|
219
|
+
{path: "packaging.name"},
|
|
220
|
+
];
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
data: function () {
|
|
224
|
+
return {
|
|
225
|
+
usage: "delivery",
|
|
226
|
+
initial_state_key: "select_document",
|
|
227
|
+
states: {
|
|
228
|
+
// TODO: likely we can trash this state and merge it w/ "deliver" (as "confirm_done")
|
|
229
|
+
select_document: {
|
|
230
|
+
display_info: {
|
|
231
|
+
title: "Start by scanning something",
|
|
232
|
+
scan_placeholder: "Scan pack / product / picking / location",
|
|
233
|
+
},
|
|
234
|
+
on_scan: (scanned) => {
|
|
235
|
+
this.wait_call(
|
|
236
|
+
this.odoo.call("scan_deliver", {barcode: scanned.text})
|
|
237
|
+
);
|
|
238
|
+
},
|
|
239
|
+
on_manual_selection: (evt) => {
|
|
240
|
+
this.wait_call(this.odoo.call("list_stock_picking"));
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
deliver: {
|
|
244
|
+
display_info: {
|
|
245
|
+
title: "Scan another document",
|
|
246
|
+
scan_placeholder: "Scan pack / product / picking / location",
|
|
247
|
+
},
|
|
248
|
+
events: {
|
|
249
|
+
cancel_picking_line: "on_cancel",
|
|
250
|
+
},
|
|
251
|
+
on_scan: (scanned) => {
|
|
252
|
+
this.wait_call(
|
|
253
|
+
this.odoo.call("scan_deliver", {
|
|
254
|
+
barcode: scanned.text,
|
|
255
|
+
picking_id: this.current_picking().id,
|
|
256
|
+
location_id: this.current_location().id,
|
|
257
|
+
})
|
|
258
|
+
);
|
|
259
|
+
},
|
|
260
|
+
on_manual_selection: (evt) => {
|
|
261
|
+
this.wait_call(
|
|
262
|
+
this.odoo.call("list_stock_picking", {
|
|
263
|
+
location_id: this.current_location().id,
|
|
264
|
+
})
|
|
265
|
+
);
|
|
266
|
+
},
|
|
267
|
+
on_cancel: (data) => {
|
|
268
|
+
let endpoint, endpoint_data;
|
|
269
|
+
// TODO: can't we have a single endpoint as per checkout.summary.destroy?
|
|
270
|
+
if (data.package_id) {
|
|
271
|
+
endpoint = "reset_qty_done_pack";
|
|
272
|
+
endpoint_data = {
|
|
273
|
+
package_id: data.package_id,
|
|
274
|
+
picking_id: this.current_picking().id,
|
|
275
|
+
};
|
|
276
|
+
} else {
|
|
277
|
+
endpoint = "reset_qty_done_line";
|
|
278
|
+
endpoint_data = {
|
|
279
|
+
move_line_id: data.line_id,
|
|
280
|
+
picking_id: this.current_picking().id,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
this.wait_call(this.odoo.call(endpoint, endpoint_data));
|
|
284
|
+
},
|
|
285
|
+
on_mark_as_done: () => {
|
|
286
|
+
this.wait_call(
|
|
287
|
+
this.odoo.call("done", {
|
|
288
|
+
picking_id: this.current_picking().id,
|
|
289
|
+
})
|
|
290
|
+
);
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
manual_selection: {
|
|
294
|
+
display_info: {
|
|
295
|
+
title: "Scan a document or select it",
|
|
296
|
+
scan_placeholder: "Filter this list by name search",
|
|
297
|
+
},
|
|
298
|
+
events: {
|
|
299
|
+
select: "on_select",
|
|
300
|
+
go_back: "on_back",
|
|
301
|
+
},
|
|
302
|
+
on_scan: (scanned) => {
|
|
303
|
+
this.state_set_data({filtered: scanned.text});
|
|
304
|
+
},
|
|
305
|
+
on_back: () => {
|
|
306
|
+
this.state_to("start");
|
|
307
|
+
this.reset_notification();
|
|
308
|
+
},
|
|
309
|
+
on_select: (selected) => {
|
|
310
|
+
this.wait_call(
|
|
311
|
+
this.odoo.call("scan_deliver", {barcode: selected.name})
|
|
312
|
+
);
|
|
313
|
+
},
|
|
314
|
+
visible_records: (records) => {
|
|
315
|
+
const self = this;
|
|
316
|
+
let visible_records =
|
|
317
|
+
this.utils.wms.order_picking_by_completeness(records);
|
|
318
|
+
if (this.state.data.filtered) {
|
|
319
|
+
visible_records = _.filter(visible_records, function (rec) {
|
|
320
|
+
return rec.name.search(self.state.data.filtered) > 0;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
return visible_records;
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
// TODO: likely we don't need this state as we could handle this in "deliver"
|
|
327
|
+
confirm_done: {
|
|
328
|
+
display_info: {
|
|
329
|
+
title: "Confirm done",
|
|
330
|
+
},
|
|
331
|
+
events: {
|
|
332
|
+
go_back: "on_back",
|
|
333
|
+
},
|
|
334
|
+
on_confirm: () => {
|
|
335
|
+
this.wait_call(
|
|
336
|
+
this.odoo.call("done", {
|
|
337
|
+
picking_id: this.current_picking().id,
|
|
338
|
+
confirm: true,
|
|
339
|
+
})
|
|
340
|
+
);
|
|
341
|
+
},
|
|
342
|
+
on_back: () => {
|
|
343
|
+
this.reset_notification();
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
process_registry.add("delivery", Delivery);
|
|
352
|
+
|
|
353
|
+
export default Delivery;
|