odoo-addon-stock-barcodes 15.0.3.1.6__py3-none-any.whl → 16.0.1.0.0.18__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/stock_barcodes/README.rst +6 -6
- odoo/addons/stock_barcodes/__manifest__.py +8 -7
- odoo/addons/stock_barcodes/data/stock_barcodes_option.xml +1 -2
- odoo/addons/stock_barcodes/hooks.py +15 -13
- odoo/addons/stock_barcodes/i18n/es.po +2 -2
- odoo/addons/stock_barcodes/i18n/it.po +5 -5
- odoo/addons/stock_barcodes/i18n/stock_barcodes.pot +190 -160
- odoo/addons/stock_barcodes/models/__init__.py +1 -1
- odoo/addons/stock_barcodes/models/stock_barcodes_action.py +2 -1
- odoo/addons/stock_barcodes/models/stock_barcodes_option.py +2 -4
- odoo/addons/stock_barcodes/models/stock_move.py +37 -0
- odoo/addons/stock_barcodes/models/stock_move_line.py +8 -14
- odoo/addons/stock_barcodes/models/stock_picking.py +9 -36
- odoo/addons/stock_barcodes/models/stock_picking_type.py +5 -6
- odoo/addons/stock_barcodes/models/stock_quant.py +3 -4
- odoo/addons/stock_barcodes/security/ir.model.access.csv +0 -2
- odoo/addons/stock_barcodes/static/description/index.html +9 -11
- odoo/addons/stock_barcodes/static/src/css/stock.scss +41 -5
- odoo/addons/stock_barcodes/static/src/utils/barcode_handler_field.esm.js +36 -0
- odoo/addons/stock_barcodes/static/src/utils/barcodes_models_utils.esm.js +25 -0
- odoo/addons/stock_barcodes/static/src/views/form_view.esm.js +17 -0
- odoo/addons/stock_barcodes/static/src/views/kanban_renderer.esm.js +149 -0
- odoo/addons/stock_barcodes/static/src/views/view_compiler.esm.js +16 -0
- odoo/addons/stock_barcodes/static/src/views/views.esm.js +193 -0
- odoo/addons/stock_barcodes/static/src/widgets/boolean_toggle.esm.js +26 -0
- odoo/addons/stock_barcodes/static/src/widgets/numeric_step.esm.js +40 -0
- odoo/addons/stock_barcodes/static/src/widgets/numeric_step.xml +17 -0
- odoo/addons/stock_barcodes/static/src/widgets/view_button.esm.js +8 -0
- odoo/addons/stock_barcodes/static/src/widgets/view_button.xml +14 -0
- odoo/addons/stock_barcodes/tests/common.py +167 -0
- odoo/addons/stock_barcodes/tests/test_stock_barcodes.py +4 -172
- odoo/addons/stock_barcodes/tests/test_stock_barcodes_new_lot.py +2 -2
- odoo/addons/stock_barcodes/tests/test_stock_barcodes_picking.py +8 -8
- odoo/addons/stock_barcodes/views/stock_barcodes_option_view.xml +1 -1
- odoo/addons/stock_barcodes/views/stock_picking_views.xml +4 -3
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read.py +45 -91
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory.py +1 -4
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory_views.xml +14 -15
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking.py +256 -92
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking_views.xml +59 -37
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo.py +33 -107
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo_view.xml +70 -28
- odoo/addons/stock_barcodes/wizard/stock_barcodes_read_views.xml +172 -189
- odoo/addons/stock_barcodes/wizard/stock_production_lot.py +2 -2
- odoo/addons/stock_barcodes/wizard/stock_production_lot_views.xml +6 -8
- {odoo_addon_stock_barcodes-15.0.3.1.6.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/METADATA +11 -11
- odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info/RECORD +66 -0
- {odoo_addon_stock_barcodes-15.0.3.1.6.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/WHEEL +1 -1
- odoo/addons/stock_barcodes/migrations/15.0.1.0.0/pre-migration.py +0 -14
- odoo/addons/stock_barcodes/models/stock_barcodes_read_log.py +0 -51
- odoo/addons/stock_barcodes/static/src/css/stock.css +0 -5
- odoo/addons/stock_barcodes/static/src/js/barcodes_models_mixin.js +0 -34
- odoo/addons/stock_barcodes/static/src/js/basic_controller.js +0 -412
- odoo/addons/stock_barcodes/static/src/js/basic_fields.js +0 -59
- odoo/addons/stock_barcodes/static/src/js/form_view.js +0 -24
- odoo/addons/stock_barcodes/static/src/js/kanban_renderer.js +0 -47
- odoo/addons/stock_barcodes/static/src/js/numeric_step.js +0 -43
- odoo_addon_stock_barcodes-15.0.3.1.6.dist-info/RECORD +0 -62
- {odoo_addon_stock_barcodes-15.0.3.1.6.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/top_level.txt +0 -0
@@ -1,412 +0,0 @@
|
|
1
|
-
/* Copyright 2018-2019 Sergio Teruel <sergio.teruel@tecnativa.com>.
|
2
|
-
* Copyright 2022 Tecnativa - Alexandre D. Díaz
|
3
|
-
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
4
|
-
|
5
|
-
odoo.define("stock_barcodes.BasicController", function (require) {
|
6
|
-
"use strict";
|
7
|
-
|
8
|
-
const BasicController = require("web.BasicController");
|
9
|
-
const BrowserDetection = require("web.BrowserDetection");
|
10
|
-
const BarcodesModelsMixin = require("stock_barcodes.BarcodesModelsMixin");
|
11
|
-
const ui = require("@web/core/utils/ui");
|
12
|
-
const getVisibleElements = ui.getVisibleElements;
|
13
|
-
|
14
|
-
BasicController.include(BarcodesModelsMixin);
|
15
|
-
BasicController.include({
|
16
|
-
/**
|
17
|
-
* @override
|
18
|
-
*/
|
19
|
-
init: function () {
|
20
|
-
this._super.apply(this, arguments);
|
21
|
-
this._is_valid_barcode_model = this._isAllowedBarcodeModel(
|
22
|
-
this.initialState.model
|
23
|
-
);
|
24
|
-
if (this._is_valid_barcode_model) {
|
25
|
-
this.BrowserDetection = new BrowserDetection();
|
26
|
-
this._keybind_selectable_index = -1;
|
27
|
-
this._keybind_selectable_items = [];
|
28
|
-
this._is_browser_chrome = this.BrowserDetection.isBrowserChrome();
|
29
|
-
const state_id = this.initialState.data.id;
|
30
|
-
this._areAccessKeyVisible = false;
|
31
|
-
if (state_id) {
|
32
|
-
this._channel_barcode = `stock_barcodes-${this.initialState.data.id}`;
|
33
|
-
|
34
|
-
if (this.call("bus_service", "isMasterTab")) {
|
35
|
-
this.call("bus_service", "addChannel", this._channel_barcode);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
},
|
40
|
-
|
41
|
-
/**
|
42
|
-
* @override
|
43
|
-
*/
|
44
|
-
destroy: function () {
|
45
|
-
this._super.apply(this, arguments);
|
46
|
-
if (this._is_valid_barcode_model) {
|
47
|
-
if (this.$sound_ok) {
|
48
|
-
this.$sound_ok.remove();
|
49
|
-
}
|
50
|
-
if (this.$sound_ko) {
|
51
|
-
this.$sound_ko.remove();
|
52
|
-
}
|
53
|
-
}
|
54
|
-
},
|
55
|
-
|
56
|
-
/**
|
57
|
-
* @override
|
58
|
-
*/
|
59
|
-
on_detach_callback: function () {
|
60
|
-
this._super.apply(this, arguments);
|
61
|
-
if (
|
62
|
-
this._is_valid_barcode_model &&
|
63
|
-
["form", "kanban"].indexOf(this.initialState.viewType) !== -1
|
64
|
-
) {
|
65
|
-
$(document).off("keydown", this._onDocumentKeyDown);
|
66
|
-
$(document).off("keyup", this._onDocumentKeyUp);
|
67
|
-
this.call(
|
68
|
-
"bus_service",
|
69
|
-
"off",
|
70
|
-
"notification",
|
71
|
-
this,
|
72
|
-
this.onBusNotificationBarcode
|
73
|
-
);
|
74
|
-
}
|
75
|
-
},
|
76
|
-
|
77
|
-
/**
|
78
|
-
* @override
|
79
|
-
*/
|
80
|
-
on_attach_callback: function () {
|
81
|
-
this._super.apply(this, arguments);
|
82
|
-
if (
|
83
|
-
this._is_valid_barcode_model &&
|
84
|
-
["form", "kanban"].indexOf(this.initialState.viewType) !== -1
|
85
|
-
) {
|
86
|
-
this._appendBarcodesSounds();
|
87
|
-
$(document).on("keydown", {controller: this}, this._onDocumentKeyDown);
|
88
|
-
$(document).on("keyup", {controller: this}, this._onDocumentKeyUp);
|
89
|
-
this.call(
|
90
|
-
"bus_service",
|
91
|
-
"on",
|
92
|
-
"notification",
|
93
|
-
this,
|
94
|
-
this.onBusNotificationBarcode
|
95
|
-
);
|
96
|
-
this._update_selectable_items();
|
97
|
-
}
|
98
|
-
},
|
99
|
-
|
100
|
-
/**
|
101
|
-
* Longpolling messages
|
102
|
-
*
|
103
|
-
* @param {Array} notifications
|
104
|
-
*/
|
105
|
-
onBusNotificationBarcode: function (notifications) {
|
106
|
-
for (const notif of notifications) {
|
107
|
-
const notif_type = notif.type;
|
108
|
-
const message = notif.payload;
|
109
|
-
if (notif_type === "stock_barcodes_read-" + this.initialState.data.id) {
|
110
|
-
if (message.action === "focus") {
|
111
|
-
setTimeout(() => {
|
112
|
-
this.$(`[name=${message.field_name}] input`).select();
|
113
|
-
}, 400);
|
114
|
-
}
|
115
|
-
} else if (
|
116
|
-
notif_type ===
|
117
|
-
"stock_barcodes_sound-" + this.initialState.data.id
|
118
|
-
) {
|
119
|
-
if (message.sound === "ok") {
|
120
|
-
this.$sound_ok[0].play();
|
121
|
-
} else if (message.sound === "ko") {
|
122
|
-
this.$sound_ko[0].play();
|
123
|
-
}
|
124
|
-
} else if (
|
125
|
-
notif_type ===
|
126
|
-
"stock_barcodes_notify-" + this.initialState.data.id
|
127
|
-
) {
|
128
|
-
this.displayNotification({
|
129
|
-
title: notif.payload.title,
|
130
|
-
message: notif.payload.message,
|
131
|
-
type: notif.payload.type,
|
132
|
-
sticky: true,
|
133
|
-
});
|
134
|
-
}
|
135
|
-
}
|
136
|
-
},
|
137
|
-
|
138
|
-
_addHotkeyOverlays: function () {
|
139
|
-
if (this._areAccessKeyVisible) {
|
140
|
-
return;
|
141
|
-
}
|
142
|
-
for (const el of getVisibleElements(
|
143
|
-
document,
|
144
|
-
"[data-hotkey]:not(:disabled)"
|
145
|
-
)) {
|
146
|
-
const hotkey = el.dataset.hotkey;
|
147
|
-
const overlay = document.createElement("div");
|
148
|
-
overlay.className = "o_web_hotkey_overlay";
|
149
|
-
overlay.appendChild(document.createTextNode(hotkey.toUpperCase()));
|
150
|
-
|
151
|
-
let overlayParent = false;
|
152
|
-
if (el.tagName.toUpperCase() === "INPUT") {
|
153
|
-
// Special case for the search input that has an access key
|
154
|
-
// defined. We cannot set the overlay on the input itself,
|
155
|
-
// only on its parent.
|
156
|
-
overlayParent = el.parentElement;
|
157
|
-
} else {
|
158
|
-
overlayParent = el;
|
159
|
-
}
|
160
|
-
|
161
|
-
if (overlayParent.style.position !== "absolute") {
|
162
|
-
overlayParent.style.position = "relative";
|
163
|
-
}
|
164
|
-
overlayParent.appendChild(overlay);
|
165
|
-
}
|
166
|
-
this._areAccessKeyVisible = true;
|
167
|
-
},
|
168
|
-
|
169
|
-
_removeHotkeyOverlays: function () {
|
170
|
-
if (!this._areAccessKeyVisible) {
|
171
|
-
return;
|
172
|
-
}
|
173
|
-
for (const overlay of document.querySelectorAll(".o_web_hotkey_overlay")) {
|
174
|
-
overlay.remove();
|
175
|
-
}
|
176
|
-
this._areAccessKeyVisible = false;
|
177
|
-
},
|
178
|
-
/**
|
179
|
-
* Helper to toggle access keys panel visibility
|
180
|
-
*
|
181
|
-
* @param {Boolean} status
|
182
|
-
*/
|
183
|
-
_toggleAccessKeys: function (status) {
|
184
|
-
if (status) {
|
185
|
-
this._addHotkeyOverlays();
|
186
|
-
} else {
|
187
|
-
this._removeHotkeyOverlays();
|
188
|
-
}
|
189
|
-
},
|
190
|
-
|
191
|
-
/**
|
192
|
-
* Used to manipulate fields
|
193
|
-
*
|
194
|
-
* @private
|
195
|
-
*/
|
196
|
-
_postProcessFields: function () {
|
197
|
-
// Set tabindex for readonly elements
|
198
|
-
// this is necessary to don't block the elements chain
|
199
|
-
const $fields = $("span.o_readonly_modifier");
|
200
|
-
$fields.attr("tabindex", "-1");
|
201
|
-
},
|
202
|
-
|
203
|
-
/**
|
204
|
-
* Append the audio elements to play the sounds.
|
205
|
-
* This is here because only must exists one controller at time
|
206
|
-
*
|
207
|
-
* @private
|
208
|
-
*/
|
209
|
-
_appendBarcodesSounds: function () {
|
210
|
-
this.$sound_ok = $("<audio>", {
|
211
|
-
src: "/stock_barcodes/static/src/sounds/bell.wav",
|
212
|
-
preload: "auto",
|
213
|
-
});
|
214
|
-
this.$sound_ok.appendTo("body");
|
215
|
-
this.$sound_ko = $("<audio>", {
|
216
|
-
src: "/stock_barcodes/static/src/sounds/error.wav",
|
217
|
-
preload: "auto",
|
218
|
-
});
|
219
|
-
this.$sound_ko.appendTo("body");
|
220
|
-
},
|
221
|
-
|
222
|
-
/**
|
223
|
-
* Dedicated keyboard handle for chrome browser
|
224
|
-
* @param {KeyboardEvent} ev
|
225
|
-
*/
|
226
|
-
_onPushKeyForChrome: function (ev) {
|
227
|
-
let prefixkey = "";
|
228
|
-
if (ev.shift) {
|
229
|
-
prefixkey += "shift+";
|
230
|
-
}
|
231
|
-
const elementWithAccessKey = document.querySelector(
|
232
|
-
`[data-hotkey="${prefixkey}${ev.key.toLowerCase()}"], [data-hotkey="${prefixkey}${ev.key.toUpperCase()}"]`
|
233
|
-
);
|
234
|
-
if (elementWithAccessKey) {
|
235
|
-
ev.preventDefault();
|
236
|
-
elementWithAccessKey.focus();
|
237
|
-
elementWithAccessKey.click();
|
238
|
-
}
|
239
|
-
},
|
240
|
-
|
241
|
-
/**
|
242
|
-
* @private
|
243
|
-
* @param {KeyboardEvent} ev
|
244
|
-
*/
|
245
|
-
_onDocumentKeyDown: function (ev) {
|
246
|
-
var self = (ev.data && ev.data.controller) || this;
|
247
|
-
if (self._is_valid_barcode_model) {
|
248
|
-
// ACCESS KEY PANEL MANAGEMENT
|
249
|
-
const alt = ev.altKey || ev.key === "Alt",
|
250
|
-
newEvent = _.extend({}, ev),
|
251
|
-
shift = ev.shiftKey || ev.key === "Shift";
|
252
|
-
if (ev.keyCode === 113) {
|
253
|
-
// F2
|
254
|
-
self._toggleAccessKeys(!self._areAccessKeyVisible);
|
255
|
-
} else if (self._areAccessKeyVisible && !shift && !alt) {
|
256
|
-
if (self._is_browser_chrome) {
|
257
|
-
self._onPushKeyForChrome(ev);
|
258
|
-
} else {
|
259
|
-
newEvent.altKey = true;
|
260
|
-
newEvent.shiftKey = true;
|
261
|
-
self._onKeyDown(newEvent);
|
262
|
-
}
|
263
|
-
}
|
264
|
-
// Open actions directly only when menu is active
|
265
|
-
// 1-9 Only accesskey
|
266
|
-
if (
|
267
|
-
self.initialState.data.display_menu &&
|
268
|
-
((ev.keyCode >= 50 && ev.keyCode <= 57) ||
|
269
|
-
(ev.keyCode >= 97 && ev.keyCode <= 105))
|
270
|
-
) {
|
271
|
-
self.$(
|
272
|
-
"button[data-hotkey=" +
|
273
|
-
String.fromCharCode(ev.keyCode) +
|
274
|
-
"]:visible"
|
275
|
-
).click();
|
276
|
-
}
|
277
|
-
|
278
|
-
// VIEW ACTIONS MANAGEMENT
|
279
|
-
if (ev.keyCode === 120) {
|
280
|
-
// F9
|
281
|
-
self.$("button[name='action_clean_values']").click();
|
282
|
-
} else if (ev.keyCode === 123 || ev.keyCode === 115) {
|
283
|
-
// F12 or F4
|
284
|
-
return self.open_action_menu();
|
285
|
-
// Self.$("button[name='open_actions']").click();
|
286
|
-
} else if (ev.keyCode === $.ui.keyCode.UP) {
|
287
|
-
// Search kanban buttons to navigate
|
288
|
-
ev.preventDefault();
|
289
|
-
--self._keybind_selectable_index;
|
290
|
-
if (self._keybind_selectable_index < 0) {
|
291
|
-
self._keybind_selectable_index =
|
292
|
-
self._keybind_selectable_items.length - 1;
|
293
|
-
}
|
294
|
-
self._set_focus_on_selectable_item(
|
295
|
-
self._keybind_selectable_items,
|
296
|
-
self._keybind_selectable_index
|
297
|
-
);
|
298
|
-
} else if (ev.keyCode === $.ui.keyCode.DOWN) {
|
299
|
-
ev.preventDefault();
|
300
|
-
++self._keybind_selectable_index;
|
301
|
-
if (
|
302
|
-
self._keybind_selectable_index >=
|
303
|
-
self._keybind_selectable_items.length
|
304
|
-
) {
|
305
|
-
self._keybind_selectable_index = 0;
|
306
|
-
}
|
307
|
-
self._set_focus_on_selectable_item(
|
308
|
-
self._keybind_selectable_items,
|
309
|
-
self._keybind_selectable_index
|
310
|
-
);
|
311
|
-
} else if (ev.keyCode === $.ui.keyCode.ENTER || ev.keyCode === 13) {
|
312
|
-
if ($(".modal-dialog:visible").length) {
|
313
|
-
// Workaround: Bootstrap don't close modal when use 'enter' so, force click event.
|
314
|
-
const $button_confirm = $(".modal-footer .btn-primary:visible");
|
315
|
-
if ($button_confirm.length) {
|
316
|
-
$button_confirm.click();
|
317
|
-
}
|
318
|
-
} else {
|
319
|
-
// Try to click selectable item
|
320
|
-
const selectable_clicked = self._set_click_on_selectable_item(
|
321
|
-
self._keybind_selectable_items,
|
322
|
-
self._keybind_selectable_index
|
323
|
-
);
|
324
|
-
if (!selectable_clicked) {
|
325
|
-
// If not, try default validation buttons
|
326
|
-
// Only one button is visible
|
327
|
-
const $action_confirm = self.$(
|
328
|
-
"button[name='action_confirm']:visible"
|
329
|
-
);
|
330
|
-
const $action_confirm_force = self.$(
|
331
|
-
"button[name='action_force_done']:visible"
|
332
|
-
);
|
333
|
-
if ($action_confirm.length) {
|
334
|
-
$action_confirm.click();
|
335
|
-
} else if ($action_confirm_force.length) {
|
336
|
-
$action_confirm_force.click();
|
337
|
-
}
|
338
|
-
}
|
339
|
-
}
|
340
|
-
}
|
341
|
-
}
|
342
|
-
},
|
343
|
-
|
344
|
-
_set_focus_on_selectable_item: function (items, index) {
|
345
|
-
if (items && index >= 0 && index < items.length) {
|
346
|
-
items[index].focus();
|
347
|
-
return true;
|
348
|
-
}
|
349
|
-
return false;
|
350
|
-
},
|
351
|
-
|
352
|
-
_set_click_on_selectable_item: function (items, index) {
|
353
|
-
if (items && index >= 0 && index < items.length) {
|
354
|
-
items[index].click();
|
355
|
-
return true;
|
356
|
-
}
|
357
|
-
return false;
|
358
|
-
},
|
359
|
-
|
360
|
-
_update_selectable_items: function (reset_index) {
|
361
|
-
if (reset_index) {
|
362
|
-
this._keybind_selectable_index = -1;
|
363
|
-
}
|
364
|
-
this._keybind_selectable_items = this.$(
|
365
|
-
".oe_kanban_action_button:visible,.oe_btn_quick_action:visible"
|
366
|
-
);
|
367
|
-
},
|
368
|
-
|
369
|
-
/**
|
370
|
-
* @private
|
371
|
-
* @param {KeyboardEvent} ev
|
372
|
-
*/
|
373
|
-
_onDocumentKeyUp: function (ev) {
|
374
|
-
var self = (ev.data && ev.data.controller) || this;
|
375
|
-
if (self._is_valid_barcode_model) {
|
376
|
-
if (
|
377
|
-
(!ev.altKey || ev.key !== "Alt") &&
|
378
|
-
!ev.ctrlKey &&
|
379
|
-
ev.keyCode !== 113
|
380
|
-
) {
|
381
|
-
self._toggleAccessKeys(false);
|
382
|
-
}
|
383
|
-
}
|
384
|
-
},
|
385
|
-
|
386
|
-
/* eslint-disable no-unused-vars */
|
387
|
-
update: function (params, options) {
|
388
|
-
return this._super.apply(this, arguments).then((res) => {
|
389
|
-
this._update_selectable_items(true);
|
390
|
-
return res;
|
391
|
-
});
|
392
|
-
},
|
393
|
-
|
394
|
-
/**
|
395
|
-
* @override
|
396
|
-
*/
|
397
|
-
_applyChanges: function () {
|
398
|
-
return this._super.apply(this, arguments).then((res) => {
|
399
|
-
this._update_selectable_items();
|
400
|
-
return res;
|
401
|
-
});
|
402
|
-
},
|
403
|
-
|
404
|
-
open_action_menu: function () {
|
405
|
-
return this.do_action("stock_barcodes.action_stock_barcodes_action", {
|
406
|
-
name: "Barcode wizard menu",
|
407
|
-
res_model: "wiz.stock.barcodes.read.picking",
|
408
|
-
type: "ir.actions.act_window",
|
409
|
-
});
|
410
|
-
},
|
411
|
-
});
|
412
|
-
});
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/* Copyright 2018-2019 Sergio Teruel <sergio.teruel@tecnativa.com>.
|
2
|
-
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
3
|
-
|
4
|
-
odoo.define("stock_barcodes.FieldFloatNumericMode", function (require) {
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
var basic_fields = require("web.basic_fields");
|
8
|
-
var field_registry = require("web.field_registry");
|
9
|
-
|
10
|
-
var FieldFloatNumericMode = basic_fields.FieldFloat.extend({
|
11
|
-
events: _.extend({}, basic_fields.FieldFloat.prototype.events, {
|
12
|
-
focusin: "_onFocusIn",
|
13
|
-
}),
|
14
|
-
_onFocusIn: function () {
|
15
|
-
// Auto select all content when user enters into fields with this
|
16
|
-
// widget.
|
17
|
-
this.$input.select();
|
18
|
-
},
|
19
|
-
_prepareInput: function ($input) {
|
20
|
-
// Set numeric mode to display numeric keyboard in mobile devices
|
21
|
-
var $input_numeric = this._super($input);
|
22
|
-
$input_numeric.attr({inputmode: "numeric"});
|
23
|
-
return $input_numeric;
|
24
|
-
},
|
25
|
-
});
|
26
|
-
|
27
|
-
var FieldBarcodeBooleanToggle = basic_fields.BooleanToggle.extend({
|
28
|
-
/*
|
29
|
-
This is needed because, whenever we click the checkbox to enter data
|
30
|
-
manually, the checkbox will be focused causing that when we scan the
|
31
|
-
barcode afterwards, it will not perform the python on_barcode_scanned
|
32
|
-
function.
|
33
|
-
*/
|
34
|
-
_onClick: function (event) {
|
35
|
-
this._super(event);
|
36
|
-
// This.getFocusableElement().blur();
|
37
|
-
// HACK: Fails normal way
|
38
|
-
_.defer(() => {
|
39
|
-
this.getFocusableElement().blur();
|
40
|
-
});
|
41
|
-
},
|
42
|
-
|
43
|
-
_render: function () {
|
44
|
-
this._super.apply(this, arguments);
|
45
|
-
const accesskey = this.attrs && this.attrs.accesskey;
|
46
|
-
if (accesskey) {
|
47
|
-
this.$el.attr("accesskey", accesskey);
|
48
|
-
}
|
49
|
-
},
|
50
|
-
});
|
51
|
-
|
52
|
-
field_registry.add("FieldFloatNumericMode", FieldFloatNumericMode);
|
53
|
-
field_registry.add("FieldBarcodeBooleanToggle", FieldBarcodeBooleanToggle);
|
54
|
-
|
55
|
-
return {
|
56
|
-
FieldFloatNumericMode: FieldFloatNumericMode,
|
57
|
-
FieldBarcodeBooleanToggle: FieldBarcodeBooleanToggle,
|
58
|
-
};
|
59
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/* Copyright 2021 Tecnativa - Alexandre D. Díaz
|
2
|
-
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
3
|
-
|
4
|
-
odoo.define("stock_barcodes.FormView", function (require) {
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
var FormView = require("web.FormView");
|
8
|
-
|
9
|
-
FormView.include({
|
10
|
-
/**
|
11
|
-
* Adds support to define the 'control_panel_hidden' context key to
|
12
|
-
* override 'withControlPanel' option.
|
13
|
-
*
|
14
|
-
* @override
|
15
|
-
*/
|
16
|
-
_extractParamsFromAction: function (action) {
|
17
|
-
const params = this._super.apply(this, arguments);
|
18
|
-
if (action && action.context && action.context.control_panel_hidden) {
|
19
|
-
params.withControlPanel = false;
|
20
|
-
}
|
21
|
-
return params;
|
22
|
-
},
|
23
|
-
});
|
24
|
-
});
|
@@ -1,47 +0,0 @@
|
|
1
|
-
/* Copyright 2022 Tecnativa - Alexandre D. Díaz
|
2
|
-
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
3
|
-
odoo.define("stock_barcodes.KanbanRenderer", function (require) {
|
4
|
-
"use strict";
|
5
|
-
|
6
|
-
const BasicController = require("web.BasicController");
|
7
|
-
const KanbanRenderer = require("web.KanbanRenderer");
|
8
|
-
const BarcodesModelsMixin = require("stock_barcodes.BarcodesModelsMixin");
|
9
|
-
|
10
|
-
KanbanRenderer.include(BarcodesModelsMixin);
|
11
|
-
KanbanRenderer.include({
|
12
|
-
/**
|
13
|
-
* @override
|
14
|
-
*/
|
15
|
-
init: function () {
|
16
|
-
this._super.apply(this, arguments);
|
17
|
-
this._is_valid_barcode_model = this._isAllowedBarcodeModel(
|
18
|
-
this.state.model
|
19
|
-
);
|
20
|
-
if (this._is_valid_barcode_model) {
|
21
|
-
// Controller base is used when the renderer its initialized by a field
|
22
|
-
this._controller_base = this.findAncestor((parent) => {
|
23
|
-
return parent instanceof BasicController;
|
24
|
-
});
|
25
|
-
}
|
26
|
-
},
|
27
|
-
|
28
|
-
/**
|
29
|
-
* Avoid intercept events in valid barcodes models.
|
30
|
-
* This is necessary to get the event in the controller.
|
31
|
-
*
|
32
|
-
* @override
|
33
|
-
*/
|
34
|
-
_onRecordKeyDown: function (ev) {
|
35
|
-
if (
|
36
|
-
this._is_valid_barcode_model &&
|
37
|
-
this._controller_base &&
|
38
|
-
this._controller_base._onDocumentKeyDown
|
39
|
-
) {
|
40
|
-
ev.stopPropagation();
|
41
|
-
this._controller_base._onDocumentKeyDown(ev);
|
42
|
-
} else {
|
43
|
-
this._super.apply(this, arguments);
|
44
|
-
}
|
45
|
-
},
|
46
|
-
});
|
47
|
-
});
|
@@ -1,43 +0,0 @@
|
|
1
|
-
/* Copyright 2022 Tecnativa - Alexandre D. Díaz
|
2
|
-
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
3
|
-
odoo.define("stock_barcodes.web_widget_numeric_step.field", function (require) {
|
4
|
-
"use strict";
|
5
|
-
|
6
|
-
const BasicController = require("web.BasicController");
|
7
|
-
const NumericStep = require("web_widget_numeric_step.field");
|
8
|
-
const BarcodesModelsMixin = require("stock_barcodes.BarcodesModelsMixin");
|
9
|
-
|
10
|
-
NumericStep.include(BarcodesModelsMixin);
|
11
|
-
NumericStep.include({
|
12
|
-
/**
|
13
|
-
* @override
|
14
|
-
*/
|
15
|
-
init: function () {
|
16
|
-
this._super.apply(this, arguments);
|
17
|
-
this._is_valid_barcode_model = this._isAllowedBarcodeModel(this.model);
|
18
|
-
if (this._is_valid_barcode_model) {
|
19
|
-
// Controller base is used when the renderer its initialized by a field
|
20
|
-
this._controller_base = this.findAncestor((parent) => {
|
21
|
-
return parent instanceof BasicController;
|
22
|
-
});
|
23
|
-
}
|
24
|
-
},
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Avoid intercept events in valid barcodes models.
|
28
|
-
* This is necessary to get the event in the controller.
|
29
|
-
*
|
30
|
-
* @override
|
31
|
-
*/
|
32
|
-
_onKeyDown: function (ev) {
|
33
|
-
if (this._is_valid_barcode_model && ev.keyCode === $.ui.keyCode.ENTER) {
|
34
|
-
if (this._controller_base) {
|
35
|
-
ev.stopPropagation();
|
36
|
-
this._controller_base._onDocumentKeyDown(ev);
|
37
|
-
}
|
38
|
-
} else {
|
39
|
-
this._super.apply(this, arguments);
|
40
|
-
}
|
41
|
-
},
|
42
|
-
});
|
43
|
-
});
|
@@ -1,62 +0,0 @@
|
|
1
|
-
odoo/addons/stock_barcodes/README.rst,sha256=OmeLJa1RU2gd7KVsZRG331p7VmNXuq8YDqax1cn3IT0,7000
|
2
|
-
odoo/addons/stock_barcodes/__init__.py,sha256=GJDFROBciW9KNOlikIfV-4Gu8TPCJRp8ZWZCxngbDtI,206
|
3
|
-
odoo/addons/stock_barcodes/__manifest__.py,sha256=GJjJvEuz9rIH7akMnroMdDZMVVTs-7XszZLX3fwvaZU,1721
|
4
|
-
odoo/addons/stock_barcodes/hooks.py,sha256=XramAPbWa-q40rEpW_LmnNpnF-aMd_WseYb_kyG3ntQ,525
|
5
|
-
odoo/addons/stock_barcodes/data/stock_barcodes_action.xml,sha256=BYvm7V39dkqfLPCtNVpYKzqinOaIuRGCjTz9Fo5U3m4,1889
|
6
|
-
odoo/addons/stock_barcodes/data/stock_barcodes_option.xml,sha256=gBDOLurvDcRlBRg7Ni2_Uk_an9uJOpRM55LiRl9u7aA,20711
|
7
|
-
odoo/addons/stock_barcodes/i18n/es.po,sha256=5wT53pkZ1hpv5uRcHbUfLjNG7fYQyUryxIXpuN2NWio,90169
|
8
|
-
odoo/addons/stock_barcodes/i18n/it.po,sha256=aYvN1R8za2CoLHzmBcsel6DWQ_iNpD7k7nf2Tii_mnY,87075
|
9
|
-
odoo/addons/stock_barcodes/i18n/stock_barcodes.pot,sha256=2laiikKUHlvjtJP4hus5CndCF7Iv2h5jWarXuYzE4Rc,76462
|
10
|
-
odoo/addons/stock_barcodes/migrations/15.0.1.0.0/pre-migration.py,sha256=HAhq_Q8pCUpu8vHs0ukSTFX7RmEvurJDN2M49HTGomI,400
|
11
|
-
odoo/addons/stock_barcodes/models/__init__.py,sha256=vDwn77QfdOHXvQS_g4_Xjj7jWYX7WGoahPzpttpIgko,227
|
12
|
-
odoo/addons/stock_barcodes/models/stock_barcodes_action.py,sha256=fz-Ua705YkuVXKuGx9oItAB5Q5eq7i5hy0L9S68SsII,1997
|
13
|
-
odoo/addons/stock_barcodes/models/stock_barcodes_option.py,sha256=CNkfNdD9q28Lewf-kMi6VlwMSzTdMc2oocwPO1y7MoA,4924
|
14
|
-
odoo/addons/stock_barcodes/models/stock_barcodes_read_log.py,sha256=MXm4gKUDjmS8SoM-ZB5hb4NH6p9SdCo2vebinzP9270,2084
|
15
|
-
odoo/addons/stock_barcodes/models/stock_move_line.py,sha256=rMdeYBdpjLUSI7YZmu11Irfy8eEmS-AerU_WBxc6-7M,1815
|
16
|
-
odoo/addons/stock_barcodes/models/stock_picking.py,sha256=KxBHKmTgYIo9FnqPNr_OOiFZM3KNMvW6QJAcmudLRos,3649
|
17
|
-
odoo/addons/stock_barcodes/models/stock_picking_type.py,sha256=jtF5GHtE4iapX33hhLKIXyyNsMsmYADYlXDD29bXQSY,2795
|
18
|
-
odoo/addons/stock_barcodes/models/stock_quant.py,sha256=2QdFE59Evu-9zyNVa8XUxPp4pOf2oGvldG3w_x5PItY,1038
|
19
|
-
odoo/addons/stock_barcodes/readme/CONTRIBUTORS.rst,sha256=YwIWfY0nMK40FKKAJnRLWWlTZIJmEQtfr1mq3dAuWWc,317
|
20
|
-
odoo/addons/stock_barcodes/readme/DESCRIPTION.rst,sha256=fMAHjb-c2tqBWN0iQ6VcYCDx6jn4PwWfxPjXwEEjOAI,273
|
21
|
-
odoo/addons/stock_barcodes/readme/HISTORY.rst,sha256=pKGjt3TefR5ZnrjyLQxXP-6lDM0uX-KQoHlgBPXdE3k,374
|
22
|
-
odoo/addons/stock_barcodes/readme/ROADMAP.rst,sha256=Mt3sxpxWWN1se9eU5JQzu3u9aY7TnDg08jvqGcHjJvk,230
|
23
|
-
odoo/addons/stock_barcodes/readme/USAGE.rst,sha256=I3vBT7ih0lReN147-tDO6imDTuHWs-cN6PvHN06aQk8,2906
|
24
|
-
odoo/addons/stock_barcodes/security/ir.model.access.csv,sha256=GUAIZrn35Oh4aTIr7qJmtrWwNg8BvP1avdIzQhiOPIE,1584
|
25
|
-
odoo/addons/stock_barcodes/static/description/icon.png,sha256=7ksDD35buxE_kBLoeXUGbdSW_5n-LC4S-SnQSs9tz1A,2994
|
26
|
-
odoo/addons/stock_barcodes/static/description/icon.svg,sha256=aMrHV2Isu4t_jJlnLVYqbcL_icg9wT2eSSAKxQ3pgDA,69299
|
27
|
-
odoo/addons/stock_barcodes/static/description/index.html,sha256=9q4mYYbHkD-VGG9bhl7tcqz66Dsu_zYHnUrbmPJdJWk,19151
|
28
|
-
odoo/addons/stock_barcodes/static/src/css/stock.css,sha256=6U9n2kttW8cXYWMU04eEtHmY6-7Bcn3o1LAMCpC5J3c,121
|
29
|
-
odoo/addons/stock_barcodes/static/src/css/stock.scss,sha256=w8oMsOijg8cwC5uDefUr-PFMHB_NNMgK3roONAK5OLY,1984
|
30
|
-
odoo/addons/stock_barcodes/static/src/img/scan.png,sha256=DIN3r_B9kzMGmeRpqSx8K0S7RO8_FEwZudxGUYIPqSM,5405
|
31
|
-
odoo/addons/stock_barcodes/static/src/js/barcodes_models_mixin.js,sha256=nxO5UIFc0t3_i4qpp_RwEZOBx_yKR5HKBf51tn2fqAw,1062
|
32
|
-
odoo/addons/stock_barcodes/static/src/js/basic_controller.js,sha256=300tHIeY3LsJN1WzGW_1cg8E3cxUG2iU5foCPrQeexE,15620
|
33
|
-
odoo/addons/stock_barcodes/static/src/js/basic_fields.js,sha256=1jpTQE_mc6tPNqUFDaFzKyG7eF5emcNnnkyjmUZaMa4,2176
|
34
|
-
odoo/addons/stock_barcodes/static/src/js/form_view.js,sha256=bJlnfWkJ7POhE2CSl_sC7g0_cxAdAOGFsvLJrXLdqzo,757
|
35
|
-
odoo/addons/stock_barcodes/static/src/js/kanban_renderer.js,sha256=bR33zxnIgb0fQ9OjwU--LYfR7jNyrqZ45OAQKMW1Bv4,1647
|
36
|
-
odoo/addons/stock_barcodes/static/src/js/numeric_step.js,sha256=-T7cmBRABcAGw-nzr3XIDAQN49nrBkbeIUObEYDiYgY,1599
|
37
|
-
odoo/addons/stock_barcodes/static/src/sounds/bell.wav,sha256=s8_EchNk9OuAZzpZljON8IEAcKjmMD9yXZorizse24I,17684
|
38
|
-
odoo/addons/stock_barcodes/static/src/sounds/error.wav,sha256=CorSmtFges2PaeOd8l15_scmq_Dv0AxPe4_nBYb43Pk,25190
|
39
|
-
odoo/addons/stock_barcodes/tests/__init__.py,sha256=A1xFvq5EyzK2lwNHCz7G34Nz3Ynwtq9CNgEdbVdL-M0,182
|
40
|
-
odoo/addons/stock_barcodes/tests/test_stock_barcodes.py,sha256=DvTT8Ak0nAmNOofjoUc941WEuncTGIXxLHCR1a0Uago,9232
|
41
|
-
odoo/addons/stock_barcodes/tests/test_stock_barcodes_new_lot.py,sha256=aKdJnQv0qQgpt4xv2IHKxoOOKxByUBOcu4kUWfcqezQ,1063
|
42
|
-
odoo/addons/stock_barcodes/tests/test_stock_barcodes_picking.py,sha256=g-Eq5ZWc0LiNkIciIA_OtjzqzmSz1v8L9gI4rsQMgTg,19306
|
43
|
-
odoo/addons/stock_barcodes/views/stock_barcodes_action_view.xml,sha256=trxWfNOODRM5Qzxq4pSnmjz4bssFdE2FXxZcwdD9Utk,1706
|
44
|
-
odoo/addons/stock_barcodes/views/stock_barcodes_menu.xml,sha256=gYfZly4O55Pn78o6cwewlIDJqyfOJPNQicsoi-4vyak,296
|
45
|
-
odoo/addons/stock_barcodes/views/stock_barcodes_option_view.xml,sha256=spHnKXz9OYenihRW9Cnvfv-7jC6xrq2e-ZtsCNf8m4k,5238
|
46
|
-
odoo/addons/stock_barcodes/views/stock_location_views.xml,sha256=ZjbIEGztSEqNcl6xN4R8H0Np68Y0-K05QP-R47Sscps,716
|
47
|
-
odoo/addons/stock_barcodes/views/stock_picking_views.xml,sha256=Ulev5113Gir1CzKzoiWMp_e3cSk_OkT3btrMS_Ac5Gs,4753
|
48
|
-
odoo/addons/stock_barcodes/wizard/__init__.py,sha256=uUoIvaVAJWYetOqNRsGyYFjsBfMevz4UC3jkeZn_CTY,194
|
49
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read.py,sha256=-UBNovHcEiZU7dlr3OHzufFLU-h2xculiMHewGdbeYc,33249
|
50
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory.py,sha256=OA4v2gPdiKhLReQ4ZjHTTIq_xUQbbRrERTU8JZuwR9k,5089
|
51
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory_views.xml,sha256=98XV32z771eWTeAgZ19NsL9_UOJroFJr9WqSpLDI8j4,10179
|
52
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking.py,sha256=6ntI87rE29xX8oE7IqnwMjbHyjBUq0OOQi4rIQZdbl0,37429
|
53
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking_views.xml,sha256=Uujl1HPGfPF9sQWDVU6idODk821d4j8jaSuCLRRdtxs,23185
|
54
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo.py,sha256=JlfkQ4ypkZjFAvG89_fBwODVSBcZW7KDJs484d-mrug,9480
|
55
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo_view.xml,sha256=DOZKGojUd9LE0Gq2z5IRRtabx5a5i6XKBC_TXlNXPg4,9347
|
56
|
-
odoo/addons/stock_barcodes/wizard/stock_barcodes_read_views.xml,sha256=bC_08j8ZLT81iFhKhPGEb8nD6RlpT-ZfykUkvpCHjgs,33375
|
57
|
-
odoo/addons/stock_barcodes/wizard/stock_production_lot.py,sha256=-xxa2_y0Ln3THilCi5DZpauTesdtiRp9SIZiTFHff9k,2217
|
58
|
-
odoo/addons/stock_barcodes/wizard/stock_production_lot_views.xml,sha256=rsX8DUnwQVkGFfGcsYcrsfkgCh5JGmiO3BrSJilIhJc,2056
|
59
|
-
odoo_addon_stock_barcodes-15.0.3.1.6.dist-info/METADATA,sha256=oWn_PlPoin0WNiaCQam-RM9jT5ZkCdlKfp8a-0FTfvY,7613
|
60
|
-
odoo_addon_stock_barcodes-15.0.3.1.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
61
|
-
odoo_addon_stock_barcodes-15.0.3.1.6.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
62
|
-
odoo_addon_stock_barcodes-15.0.3.1.6.dist-info/RECORD,,
|
File without changes
|